Re: git whatchanged
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 20, 2025, 16:49 UTC
- Message-ID
- <xmqqfrdmaqg4.fsf@gitster.g>
- In-Reply-To
- <37da14fb-fead-448b-b6a0-853c9fbea653@app.fastmail.com>
"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:
Show 19 quoted lines
> On Tue, Aug 19, 2025, at 22:57, rsbecker@nexbridge.com wrote: >> On August 19, 2025 1:51 PM, Chris Judkins-Fisher wrote: >>>I still use git whatchanged >> >> I did too. However, now that git log --since has basically the same >> functionality, >> Perhaps setting up a git alias might do the trick for you: >> >> git config --global alias.whatchanged 'log' >> >> so >> >> git whatchanged --since="2 week" >> >> or something like that should continue to work after the command is >> removed. > > You can’t alias core commands. So this will fail in the reported way > before Git 3.0. Then from that point out it will work as an alias.
Not quite.
$ git -c alias.whatchanged='!echo bar' \ whatchanged --i-still-use-this -2 --oneline 7c10e48e81 describe: pass commit to describe_commit() :100644 100644 72b2e1162c 04df89d56b M builtin/describe.c 8cfd4ac215 describe: handle blob traversal with no commits :100644 100644 f7bea3c8c5 72b2e1162c M builtin/describe.c :100755 100755 feec57bcbc 2c70cc561a M t/t6120-describe.sh
Your alias with the same name as a real command is silently ignored, and when the real command disappears, it will start working.
Having said that, as "log --raw" is even shorter to type than "whatchanged", these people are really better off without such an alias.