-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
git-utimes: Change files modification time to their last commit date #882
Conversation
Commands.md
Outdated
Change files modification time to their last commit date. | ||
|
||
```bash | ||
## git utimes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## git utimes | |
$ git utimes |
bin/git-utimes
Outdated
else | ||
# `-n` should be limited or parallelization will not give effect, | ||
# because all args will go into single worker. | ||
NPROC=$(nproc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does not work on FreeBSD. See https://unix.stackexchange.com/questions/108821/number-of-cores-on-freebsd
|
Ping! I fixed issues @SuperSandro2000 mentioned. Whats next? |
Commands.md
Outdated
Change files modification time to their last commit date. | ||
|
||
```bash | ||
$ git utimes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to show the difference before / after running this command.
if [ "$1" = --touch ]; then | ||
# Internal use option only just to parallelize things. | ||
shift | ||
for f; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for
is to support multiple arguments. Why not? This should reduce number of exec
s. Are you against of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction: s/execs/forks/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vt-alt
I got it, it is OK.
bin/git-utimes
Outdated
touch -d "$t" "$f" | ||
fi | ||
done | ||
exit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exit
is redundant.
bin/git-utimes
Outdated
# Change files modification time to their last commit date | ||
# | ||
# Copyright (c) 2020 Vitaly Chikunov <vt@altlinux.org>. | ||
# SPDX-License-Identifier: MIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't add the Copyright and License. We already have and only have a LICENSE file.
if [ "$1" = --touch ]; then | ||
# Internal use option only just to parallelize things. | ||
shift | ||
for f; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for
is to support multiple arguments. Why not? This should reduce number of exec
s. Are you against of it?
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Force-pushed changes you requested - extended example in |
Almost three weeks passed since all requested changes are applied. Is there anything to add? |
@vt-alt |
@spacewander Thanks! |
New tool to change files modification time to their last commit date.