| Age | Commit message (Collapse) | Author | Files | Lines |
|
After a bisect session begins and up until the first 'bad' and 'good'
revisions are identified, BISECT_EXPECTED_REV is undefined, and the
freshly started session goes undetected by git-precheck.
Among a few potential alternatives, BISECT_START is a better signal, as
it covers this gap and exists for the entire duration of a session -
from 'git bisect start' to 'git bisect reset'.
The file-based detection paradigm makes this choice more obvious.
Signed-off-by: Matt Hunter <m@lfurio.us>
|
|
Signed-off-by: Matt Hunter <m@lfurio.us>
|
|
Detect all ongoing git conditions by checking for the existence of some
file or directory within the .git folder. This eliminates the previous
git rev-parse --verify commands, which should be a slight boost to
performance. Furthermore, the implementation of rebase detection is no
longer a special case.
Also, restructure the script such that all applicable conditions are
reported when run, not just the first we detect. The script exit code
reflects the highest value of the active conditions. Though, as an
optimization, still exit on the first found when --quiet is in effect.
The script is cleaned up as well. In some cases style is changed to
better match the current state of git-sonar. git-status is now only
called once and cached for both dirty and untracked detection.
Signed-off-by: Matt Hunter <m@lfurio.us>
|
|
REBASE_HEAD will sometimes be left behind in .git after an interactive
rebase concludes (if the last step completed was a squash or edit, for
instance). Likewise, it may be missing _during_ a rebase, such as when
paused on a break command.
Instead, use the presence of the rebase-merge or rebase-apply
directories as the "rebase in progress" signal. Note still that
rebase-apply will exist during git-am as well.
These two directories are utilized by the two rebase implementation
backends, so we shouldn't normally expect to see them both at the same
time.
Signed-off-by: Matt Hunter <m@lfurio.us>
|
|
Capitalizing the first letter of these terms, when they don't usually
appear that way in git or its documentation, looks out of place.
Signed-off-by: Matt Hunter <m@lfurio.us>
|
|
Signed-off-by: Matt Hunter <m@lfurio.us>
|
|
This is an alternative entrypoint primarily intended for use in other
scripts. The purpose of git-precheck is to easily determine the state
of a git repository before going on to perform additional, possibly
disruptive work.
git-precheck tries to cover as many bases as possible - odd cases like
'merge in progress', 'cherry-pick in progress', etc. By default, we
only exit success (0) if we are in a repo that is completely clean (no
file modifications or untracked files present) and has no ongoing
operation.
Signed-off-by: Matt Hunter <m@lfurio.us>
|