* I use whatchanged!
@ 2025-08-20 19:20 Dan Allen
2025-08-20 20:46 ` Kristoffer Haugsbakk
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Dan Allen @ 2025-08-20 19:20 UTC (permalink / raw)
To: git
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
Thanks!
Dan Allen
Idaho Falls, ID
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: I use whatchanged!
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-20 20:53 ` Junio C Hamano
2025-08-20 20:57 ` Ben Zanin
2 siblings, 1 reply; 7+ messages in thread
From: Kristoffer Haugsbakk @ 2025-08-20 20:46 UTC (permalink / raw)
To: Dan Allen, git
On Wed, Aug 20, 2025, at 21:20, Dan Allen wrote:
> 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
According to git-whatchanged(1)
replace: git whatchanged <opts>
with: git log <opts> --raw --no-merges
Should be enough.
--
semantic drift
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: I use whatchanged!
2025-08-20 19:20 I use whatchanged! Dan Allen
2025-08-20 20:46 ` Kristoffer Haugsbakk
@ 2025-08-20 20:53 ` Junio C Hamano
2025-08-20 20:57 ` Ben Zanin
2 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2025-08-20 20:53 UTC (permalink / raw)
To: Dan Allen; +Cc: git
Dan Allen <danallen46@gmail.com> writes:
> The exact usage in the script is:
>
> git whatchanged --pretty=%at
And "git log --raw --pretty=%at" does not fit your need?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: I use whatchanged!
2025-08-20 19:20 I use whatchanged! Dan Allen
2025-08-20 20:46 ` Kristoffer Haugsbakk
2025-08-20 20:53 ` Junio C Hamano
@ 2025-08-20 20:57 ` Ben Zanin
2025-08-25 8:54 ` Jeff King
2 siblings, 1 reply; 7+ messages in thread
From: Ben Zanin @ 2025-08-20 20:57 UTC (permalink / raw)
To: Dan Allen; +Cc: git
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: I use whatchanged!
2025-08-20 20:57 ` Ben Zanin
@ 2025-08-25 8:54 ` Jeff King
2025-08-25 15:59 ` Junio C Hamano
0 siblings, 1 reply; 7+ messages in thread
From: Jeff King @ 2025-08-25 8:54 UTC (permalink / raw)
To: Ben Zanin; +Cc: Dan Allen, git
On Wed, Aug 20, 2025 at 04:57:43PM -0400, Ben Zanin wrote:
> 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
Looks like those are cases where the commit is empty (it's not a merge,
and has the same tree as its first parent). E.g.:
$ commits=8d2709d075d65ba386a4dac157129ef868c283e5^-
$ git log --oneline --raw --no-merges $commits
8d2709d075 A few hotfixes before -rc2
$ git whatchanged --i-still-use-this $commits
[no output]
The culprit is the revs.always_show_header flag, which git-log sets but
git-whatchanged does not. I don't think there is a way to influence it
with an option, though. You can simplify history by giving a pathspec,
but that can have broader changes (e.g., it may also simplify away side
branches).
I don't know if that's an option that should be added before declaring
whatchanged dead. Arguably the git-log behavior is much more reasonable,
but I don't know if anybody cares about being byte-for-byte identical to
whatchanged behavior.
-Peff
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: I use whatchanged!
2025-08-25 8:54 ` Jeff King
@ 2025-08-25 15:59 ` Junio C Hamano
0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2025-08-25 15:59 UTC (permalink / raw)
To: Jeff King; +Cc: Ben Zanin, Dan Allen, git
Jeff King <peff@peff.net> writes:
> The culprit is the revs.always_show_header flag, which git-log sets but
> git-whatchanged does not. I don't think there is a way to influence it
> with an option, though. You can simplify history by giving a pathspec,
> but that can have broader changes (e.g., it may also simplify away side
> branches).
>
> I don't know if that's an option that should be added before declaring
> whatchanged dead. Arguably the git-log behavior is much more reasonable,
> but I don't know if anybody cares about being byte-for-byte identical to
> whatchanged behavior.
"git log" behaviour of showing the presence of empty commits is
reasonable in the context of "showing the log". "git whatchanged"
bbehaviour of reporting which commits changed things (either in the
whole tree, or limited by pathspec) and omitting is reasonable in
the context of "showing what commit changed these things".
I do not think byte-for-byte identical output is a requirement, but
I of course am biased ;-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: I use whatchanged!
[not found] ` <280B51C1-CE87-4953-89CE-6310ECEC9D61@gmail.com>
@ 2025-08-28 6:31 ` Kristoffer Haugsbakk
0 siblings, 0 replies; 7+ messages in thread
From: Kristoffer Haugsbakk @ 2025-08-28 6:31 UTC (permalink / raw)
To: Dan Allen; +Cc: git
On Fri, Aug 22, 2025, at 15:52, Dan Allen wrote:
>> On 20 Aug 2025, at 14:46, Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com> wrote:
>>[snip]
>> According to git-whatchanged(1)
>>
>> replace: git whatchanged <opts>
>> with: git log <opts> --raw --no-merges
>>
>> Should be enough.
>>
>> --
>> semantic drift
>
> That works! Thank you.
That’s great. Just remember to use reply-all on this list.
Cheers
--
Kristoffer
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-08-28 6:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-08-25 8:54 ` Jeff King
2025-08-25 15:59 ` Junio C Hamano
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).