git-toolbelt icon indicating copy to clipboard operation
git-toolbelt copied to clipboard

Replacing `rev` in `git-modified`; second try

Open ernstki opened this issue 1 year ago • 3 comments

I'm looking for a way to accomplish what git-modified is accomplishing with rev, without rev, as discussed in #29 and incorrectly implemented in #39.

https://github.com/nvie/git-toolbelt/blob/2eec073a4e12b7f6e70f6d4713de75b8642c4e90/git-modified#L124

It looks like you had to do the rev stuff in 4ea5c29 to account for some change in the output of git log circa 2018.

I didn't understand what was going on with the revs there for a good long while, but now I do[^fn1]; when a rename happens, there are three columns in the output, and you want the last one.

@nvie, would you be amenable to using awk for this, or is that a dependency you'd hoped to steer clear of? People are likely to have a functional awk even if they're missing rev, although I'll have to double-check if that's the case with Git Bash. On the other hand, some sort of while IFS="$TAB" reading might do the trick, too, in plain shell script.

[^fn1]: this SO question was helpful in that regard

ernstki avatar Apr 17 '23 14:04 ernstki