-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from ESMCI/issue-86-detached-sync-status
git: rework logic for determining in-sync and current ref name Rework two aspects of the logic for git repositories; both of these can change behavior in some cases when printing status: 1. Determining whether the local checkout is in-sync with the expected reference from the configuration file: Now we always convert the expected reference to a hash and compare that with the currently-checked-out hash. Previously, we sometimes did the comparison using names, e.g., just ensuring that you're on the right branch. 2. Determining the current ref name (e.g., the branch or tag currently checked out). Now we use a number of plumbing commands rather than relying on regex parsing of 'git branch -vv'. The previous regex parsing was fragile and hard to maintain, and was the source of a number of bugs. In addition, differences between git v. 1 and git v. 2 meant that the result was incorrect in some cases - particularly, in the case where we have "detached from foo" (which is the text that always appeared for a detached head in v 1, but in v 2 means we are no longer at foo). I have also overhauled the unit tests covering this functionality. Many tests were no longer needed with the new logic and so I have removed them. I have added some other tests covering the new functionality. User interface changes?: Yes - Subtle changes to status output, as described above - One particular change is: If we're on a tracking branch, `checkout_externals -S -v` will show the name of the local branch rather than the tracked branch. (This is more accurate, because we may not actually be at the head of the tracking branch.) Fixes: #86 (Status incorrectly reports in-sync when you have made commits in detached head state - fixed due to the change in (1)). Testing: test removed: many no-longer-relevant unit tests unit tests: pass system tests: pass manual testing: basic manual testing of checking out and running status, in the context of cesm and ctsm
- Loading branch information
Showing
4 changed files
with
615 additions
and
591 deletions.
There are no files selected for viewing
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
Oops, something went wrong.