-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve handling of pinned packages #14
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…hed HEAD situations
The current behaviour when commit: or tag: was given was to create a detached HEAD, which is really really less than ideal. Since we are going to use those a lot more, this commit tries to find a better way. Namely, autobuild now resets the local branch to the commit while trying to preserve uncommitted changes. It will do so only if the branch contains only commits that are already on the remote origin.
While most of the git CLI is fairly stable and backward compatible, it happens that it breaks. For instance git update-index --cacheinfo was given arguments delimited by spaces but is now (2.1.0) expecting them with commas.
This fixes a failure in #commit_pinning, where update-ref gets called with a tag instead of a commit by resolving the commit explicitely. Moreover, it fixes the rescue clause to ensure that it does not create a detached HEAD
the :at_least_version method had a sign error, and would return the inverse of what would be expected.
For convenience, really
This closes rock-core/autoproj#39 and is required for the implementation of rock-core/autoproj#37. It adds a reset option to #import which controls what to do if the local working copy is not exactly the state specified by the importer configuration. The only one which acts on it is really the git importer, the other ones simply ignore it. This modifies the importer API in a backward-compatible way, changing the second argument from a boolean to an option hash, but allowing the boolean to be still passed as-is In addition, it implements a fast path in the git importer in case the commit/tag is already available.
doudou
force-pushed
the
improve_handling_of_detached_head
branch
from
February 5, 2015 16:22
f2bac32
to
e650309
Compare
Somewhat, the updated test SVN root got lost
…ready at the target revision
This went unnotticed as it passed the option object as-is to Importer#import
This is the first step towards removing all these horrible globals ...
env_clear clears the inherited environment as well. We really only want to delete the current value for the environment
env_set had a bug related to rock-core/autoproj#43. This adds some tests for corner-cases and fixes that particular bug.
To check for the presence of a SHA, you have to explicitly give the object type you're looking for (in this case, a commit)
…tely_error_message git: improve error message when the local HEAD is not present in remote_...
doudou
added a commit
that referenced
this pull request
Mar 3, 2015
Improve handling of pinned packages
There are no outstanding bugs not tagged with post-versioning anymore, I'm merging it (as discussed last time). |
2maz
pushed a commit
to 2maz/autobuild
that referenced
this pull request
Apr 29, 2015
…ing_warning_to_current_os osdep: warn about osdep overriding each other only for this specific OS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This set of commit improves the handling of detached HEAD, and simplifies the update logic in the git importer quite a lot in the process.
So far, the git importer would create a detached HEAD when pinned to a commit or tag. This is really really confusing for users, as using git on a detached HEAD is weird (and it is easy to "lose" data when using them).
Instead, after this pull request, the importer will NEVER create a detached HEAD. It will checkout the branch setup in the importer (i.e. the "local branch") and either reset it to the pinned commit if all other commits are present remotely, or generate an error.
Uncommitted changes are handled the way "git checkout" handles them. That is, they are applied on the new HEAD if possible, or the reset is aborted (with error) if they don't.