Skip to content

git: Replace a few porcelain commands with plumbing commands#263

Open
jerry-skydio wants to merge 1 commit into
mainfrom
jerry/revup/main/useplumb
Open

git: Replace a few porcelain commands with plumbing commands#263
jerry-skydio wants to merge 1 commit into
mainfrom
jerry/revup/main/useplumb

Conversation

@jerry-skydio

Copy link
Copy Markdown
Collaborator
  • diff --cached -> diff-index --cached (index vs tree, immune to the
    stale-mtime quirk)
  • diff ~ -> 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 : -> cat-file -p, the plumbing equivalent for reading
    a blob, used when dumping conflict markers.

@jerry-skydio

Copy link
Copy Markdown
Collaborator Author

Reviews in this chain:
#263 git: Replace a few porcelain commands with plumbing commands

@jerry-skydio

jerry-skydio commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator Author
# head base diff date summary
0 44ac06d0 e03937b2 diff Jun 19 14:10 PM 2 files changed, 33 insertions(+), 8 deletions(-)
1 f58f9458 e03937b2 diff Jun 19 14:11 PM 1 file changed, 2 deletions(-)
2 81f1de0f e03937b2 diff Jun 19 14:19 PM 1 file changed, 2 insertions(+), 16 deletions(-)

- 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.
@jerry-skydio jerry-skydio force-pushed the jerry/revup/main/useplumb branch from f58f945 to 81f1de0 Compare June 19, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants