Re: [PATCH v2 2/2] whatchanged: require --i-still-use-this
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 2, 2025, 16:49 UTC
- Message-ID
- <xmqqo6wbufel.fsf@gitster.g>
- In-Reply-To
- <aBSLgTlfwSc1u_bH@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
> I was briefly wondering why this variable wasn't just declared in > `cmd_whatchanged()`, but that's because parsing is of course done by > `cmd_log_init_finish()`. Nothing worth thinking about too much.
Yeah, it is between "cfg that is conveniently passed around the code paths, even though it is not a configuration item" vs "a file-scope static variable that will live until we decide to remove (or keep) the command".
Show 15 quoted lines
>> @@ -656,6 +665,10 @@ int cmd_whatchanged(int argc,
>> opt.def = "HEAD";
>> opt.revarg_opt = REVARG_COMMITTISH;
>> cmd_log_init(argc, argv, prefix, &rev, &opt, &cfg);
>> +
>> + if (!cfg.i_still_use_this)
>> + you_still_use_that("git whatchanged");
>> +
>> if (!rev.diffopt.output_format)
>> rev.diffopt.output_format = DIFF_FORMAT_RAW;
>>
>
> I think it would help potential users of this command quite a bit if we
> explicitly told them what the replacement is. So maybe we can extend
> `you_still_use_that()` to accept an explanation?I doubt it. The reason why we remove something is not "because a better alternative exists"; it is "because everybody *HAS* switched to the better alternative". If we need to educate folks in this message, the plan to remove that command is still premature.