git: Replace a few porcelain commands with plumbing commands#263
Open
jerry-skydio wants to merge 1 commit into
Open
git: Replace a few porcelain commands with plumbing commands#263jerry-skydio wants to merge 1 commit into
jerry-skydio wants to merge 1 commit into
Conversation
Collaborator
Author
|
Reviews in this chain: |
Collaborator
Author
44ac06d to
f58f945
Compare
- diff --cached -> diff-index --cached (index vs tree, immune to the stale-mtime quirk) - diff <commit>~ <commit> -> diff-tree - stat/shortstat conversions add -M since porcelain detects renames by default; --no-renames cases don't. - -r is added so subdirectories are recursed. The worktree comparison in get_has_unstaged is intentionally left as porcelain: diff-index returns 1 on a refreshed mtime with no content change, which would report spurious unstaged changes. - branch --show-current -> symbolic-ref -q --short HEAD. The -q with raiseonerror=False preserves the porcelain behavior of returning empty on a detached HEAD instead of erroring. - show <tree>:<path> -> cat-file -p, the plumbing equivalent for reading a blob, used when dumping conflict markers.
f58f945 to
81f1de0
Compare
This file contains hidden or 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
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.
stale-mtime quirk)
default; --no-renames cases don't.
The worktree comparison in get_has_unstaged is intentionally left as
porcelain: diff-index returns 1 on a refreshed mtime with no content
change, which would report spurious unstaged changes.
raiseonerror=False preserves the porcelain behavior of returning empty
on a detached HEAD instead of erroring.
a blob, used when dumping conflict markers.