Skip to content

git absorb seems to ignore git CLI config override options #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gibson042 opened this issue Apr 23, 2025 · 1 comment
Open

git absorb seems to ignore git CLI config override options #187

gibson042 opened this issue Apr 23, 2025 · 1 comment
Labels
upstream Blocked on upstream libgit2/git2rs

Comments

@gibson042
Copy link

The git CLI supports overriding configuration with options like -c absorb.fixupTargetAlwaysSHA, but these appear to be ignored by git-absorb (unlike GIT_CONFIG_GLOBAL/GIT_CONFIG_SYSTEM environment variables, which seem to be respected):

$ AWK_SCAN_OUTPUT='  
/would have committed/ {
  if(match($0, /[0-9a-fA-F]{8,}/)) by_hash++; else by_subject++;
}
END {
  printf "%d by hash, %d by subject\n", by_hash, by_subject;
}
'

$ git absorb --dry-run 2>&1 | awk "$AWK_SCAN_OUTPUT"
0 by hash, 2 by subject

$ git -c absorb.fixupTargetAlwaysSHA absorb --dry-run 2>&1 | awk "$AWK_SCAN_OUTPUT"
0 by hash, 2 by subject

$ printf '[absorb]\n    fixupTargetAlwaysSHA = true\n' > /tmp/dummy-gitconfig

$ cat /tmp/dummy-gitconfig 
[absorb]
    fixupTargetAlwaysSHA = true

$ GIT_CONFIG_GLOBAL=/tmp/dummy-gitconfig git absorb --dry-run 2>&1 | awk "$AWK_SCAN_OUTPUT"
2 by hash, 0 by subject

Reading the source code suggests to me that the issue is probably in either git2 or in this code's use of it.

@blairconrad
Copy link
Contributor

Possible upstream issue? libgit2/libgit2#3854

@tummychow tummychow added the upstream Blocked on upstream libgit2/git2rs label Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Blocked on upstream libgit2/git2rs
Projects
None yet
Development

No branches or pull requests

3 participants