feat(git-utimes): add ability to update directory timestamp#1247
feat(git-utimes): add ability to update directory timestamp#1247
Conversation
2d0d280 to
1d33f8b
Compare
New flag `--touch-dirs` or `-d` allows to update directory timestamp when using `git utimes` command. Refs: #1249
1d33f8b to
80d9e2e
Compare
| ;; | ||
| esac | ||
|
|
||
| shift |
There was a problem hiding this comment.
The shift modifies $@ but has no effect on the for loop's iteration (it already has its own copy).
| op=le | ||
| ;; | ||
| --touch-dirs | -d) | ||
| log_opts+=(--dirstat=files,0) |
There was a problem hiding this comment.
--dirstat=files will override --diff-filter=d, so a directory will be touched with a timestamp from a deletion-only commit. Is this expected?
There was a problem hiding this comment.
Thinking about it we might want to include deletes when touching directories.
That would mirror the unix behaviour where the directory timestamp is updated on file deletes as well.
| op=eq | ||
|
|
||
| for arg in "$@"; do | ||
| case "$arg" in |
There was a problem hiding this comment.
Inconsistent indentation
| .TH "GIT\-UTIMES" "1" "May 2022" "" "Git Extras" | ||
| .\" generated with Ronn-NG/v0.10.1 | ||
| .\" http://github.com/apjanke/ronn-ng/tree/0.10.1 | ||
| .TH "GIT\-UTIMES" "1" "January 1980" "" "Git Extras" |
There was a problem hiding this comment.
I wonder why we are back to 1980
There was a problem hiding this comment.
Didnt notice that. For some reason ronn can't get a valid date on my system. Fixed.
| @@ -91,13 +105,17 @@ FILENAME==tmpfile { | |||
| } | |||
| # skip blank lines | |||
There was a problem hiding this comment.
We should update this comment
| # dirstat line | ||
| if ($1 ~ /^.+% .+\/$/) { | ||
| # remove percentage before path | ||
| gsub(/^.+% /, "", $1) |
There was a problem hiding this comment.
When calling in a suddir, will a path be stripped twice? One in here, another in line 120
New flag
--touch-dirsor-dallows to update directory timestamp when usinggit utimescommand.Refs: #1246
I haven't done much with awk till now. Only tested under linux with git
2.53.0.