summaryrefslogtreecommitdiffstats
path: root/git-precheck (follow)
AgeCommit message (Collapse)AuthorFilesLines
46 hoursprecheck: Improve rebase detectionMatt Hunter1-2/+6
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>
46 hoursprecheck: Use lower-case git verbsMatt Hunter1-5/+5
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>
46 hoursprecheck: Show full script name in error messageMatt Hunter1-1/+1
Signed-off-by: Matt Hunter <m@lfurio.us>
2026-02-22Add git-precheck scriptMatt Hunter1-0/+94
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>