From: Andreas Schwab <schwab@linux-m68k•org>
To: Ivan Baldo <ibaldo@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: Fastest way to set files date and time to latest commit time of each one
Date: Sat, 29 Aug 2020 08:46:46 +0200 [thread overview]
Message-ID: <87bliu9cfd.fsf@linux-m68k.org> (raw)
In-Reply-To: <CAEbcw=3mOoYuJo2mQgqB2aJgn-D2i_7ZRmhfPvYNVHD1Kp8wuA@mail.gmail.com> (Ivan Baldo's message of "Fri, 28 Aug 2020 22:36:10 -0300")
I'm using this script:
#!/bin/sh
git log --name-only --format=format:%n%ct -- "$@" |
perl -e 'my $do_date = 0; chomp(my $cdup = `git rev-parse --show-cdup`);
while (<>) {
chomp;
if ($do_date) {
next if ($_ eq "");
die "Unexpected $_\n" unless /^[0-9]+$/;
$d = $_;
$do_date = 0;
} elsif ($_ eq "") {
$do_date = 1;
} elsif (!defined($seen{$_})) {
$seen{$_} = 1;
utime $d, $d, "$cdup$_";
}
}'
Andreas.
--
Andreas Schwab, schwab@linux-m68k•org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
prev parent reply other threads:[~2020-08-29 6:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-29 1:36 Fastest way to set files date and time to latest commit time of each one Ivan Baldo
2020-08-29 3:20 ` Junio C Hamano
2020-08-29 4:59 ` Raymond E. Pasco
2020-08-29 4:48 ` Eric Wong
2020-09-02 19:28 ` Ivan Baldo
2020-08-29 6:46 ` Andreas Schwab [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bliu9cfd.fsf@linux-m68k.org \
--to=schwab@linux-m68k$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
--cc=ibaldo@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox