git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Zanin <bzanin@gmail.com>
To: Dan Allen <danallen46@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: I use whatchanged!
Date: Wed, 20 Aug 2025 16:57:43 -0400	[thread overview]
Message-ID: <877byxbtiw.fsf@gmail.com> (raw)
In-Reply-To: <83241BDE-1E0D-489A-9181-C608E9FCC17B@gmail.com> (Dan Allen's message of "Wed, 20 Aug 2025 13:20:58 -0600")

Dan Allen <danallen46@gmail.com> writes:
> I just updated to git 2.51 and got the spam about whatchanged being nominated for removal.
>
> I run an important python script that uses this to set file times to
> the dates of the actual git commits, so as I browse the files I can
> see their last modified date, and not the date that the file was last
> synced.
>
> Now, if there is a different way of setting a git repository's files' mod dates to their actual date and time of last commit, please let me know!
>
> The exact usage in the script is:
>
>     git whatchanged --pretty=%at
[snip]

Dan,

Would a git-log invocation like this suit your use case?

    git log --raw --no-merges --pretty='%at'

When I test that by running it inside a working directory of the git
repo as of commit c44beea485f0f2feaf460e2ac87fdd5608d63cf0 / v2.51.0, it
looks like the output of `git whatchanged --pretty='%at'` and that of
`git log --raw --no-merges --pretty='%at'` is almost identical but for
the addition of a couple of extra timestamps in the output:

    diff -U0 \
      <(git whatchanged --i-still-use-this --pretty='%at') \
      <(git log --raw --no-merges --pretty='%at')

...gives me..:

    --- /dev/fd/63  2025-08-20 16:55:36.936065126 -0400
    +++ /dev/fd/62  2025-08-20 16:55:36.936065126 -0400
    @@ -39,0 +40 @@
    +1754972997
    @@ -3773,0 +3775 @@
    +1745540054
    @@ -18102,0 +18105 @@
    +1717188675
    @@ -210119,0 +210123 @@
    +1179951046
    @@ -243728,0 +243733 @@
    +1113865892

Is that close enough to support the functionality of your script?

-- 
	Ben

  parent reply	other threads:[~2025-08-20 20:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20 19:20 I use whatchanged! Dan Allen
2025-08-20 20:46 ` Kristoffer Haugsbakk
     [not found]   ` <280B51C1-CE87-4953-89CE-6310ECEC9D61@gmail.com>
2025-08-28  6:31     ` Kristoffer Haugsbakk
2025-08-20 20:53 ` Junio C Hamano
2025-08-20 20:57 ` Ben Zanin [this message]
2025-08-25  8:54   ` Jeff King
2025-08-25 15:59     ` Junio C Hamano

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=877byxbtiw.fsf@gmail.com \
    --to=bzanin@gmail.com \
    --cc=danallen46@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).