Re:Git-absorb: Git commit –fixup, but automatic
by psadauskas on Thursday September 26, 2024 @12:02PM
(#41660029)
I have this one in mine: https://github.com/paul/dotfiles/blob/master/git/.gitconfig#...
Given a file like `git cff path/to/file.rb`, It'll find the last commit that touched that file, and make a fixup commit for it. Its great for the try-this-change-on-CI cycle: Change the Dockerfile, git cff Dockerfile, push, repeat, without it screwing up because you changed a different file while you were working on it.
[ Parent
| on HN ]
Re:Git-absorb: Git commit –fixup, but automatic
by mdaniel on Thursday September 26, 2024 @01:15PM
(#41660844)
It won't matter until it does, but $@ expands arguments into separate words but those expansions are themselves only word-preserved if the $@ is itself quoted. The [ will probably get away with what you want, but its use in $(git add) and $(git last-sha) almost certainly will not
$ cat > tmp.sh <<'FOO'
for a in $@; do echo "a=$a"; done
echo
for b in "$@"; do echo "b=$b"; done
echo
for c in $*; do echo "c=$c"; done
echo
for d in "$*"; do echo "d=$d"; done
echo
FOO
$ bash tmp.sh 'alpha beta' $'charlie\ndelta'
a=alpha
a=beta
a=charlie
a=delta
b=alpha beta
b=charlie
delta
c=alpha
c=beta
c=charlie
c=delta
d=alpha beta charlie
delta
Re:Git-absorb: Git commit –fixup, but automatic
by psadauskas on Thursday September 26, 2024 @04:00PM
(#41662603)
Yeah, you're probably right. I guess I haven't run it on any files with spaces in the 6 years since I added it to my dotfiles.