From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH v2 0/2] Nominating "whatchanged" for removal
Date: Thu, 1 May 2025 15:59:56 -0700 [thread overview]
Message-ID: <20250501225958.2947677-1-gitster@pobox.com> (raw)
In-Reply-To: <20250501213452.370729-1-gitster@pobox.com>
This does not go far enough to touch the "Git 3.0 removal" list in
Documentation/BreakingChanges.adoc, but is a preparatory step
necessary if we ever wanted to do so in the future.
The first step is to split out the long "we marked this for removal.
tell us at git@vger.kernel.org if you still use it, and in the
meantime we refuse to proceed without --i-still-use-this" message
out of "git pack-redundant" implementation and makes it reusable.
The second step is to use that helper to mark "git whatchanged" for
removal.
Relative to the previous iteration, the only change is necessary
adjustment of tests that use "git whatchanged". The ones that
validate the output of "whatchanged" are updated to pass the
necessary "--i-still-use-this", and the ones that runs "whatchanged"
while testing other commands are rewritten to use "log --raw".
Junio C Hamano (2):
you-still-use-that??: help deprecating commands for removal
whatchanged: require --i-still-use-this
Documentation/git-whatchanged.adoc | 10 ++++++++--
builtin/log.c | 13 +++++++++++++
builtin/pack-redundant.c | 10 ++--------
git-compat-util.h | 2 ++
t/t4013-diff-various.sh | 17 +++++++++++++++--
t/t4202-log.sh | 14 +++++++++-----
t/t5323-pack-redundant.sh | 5 +++++
t/t9300-fast-import.sh | 12 ++++++------
t/t9301-fast-import-notes.sh | 2 +-
usage.c | 12 ++++++++++++
10 files changed, 73 insertions(+), 24 deletions(-)
Range-diff against v1:
1: 2e4e3906b1 = 1: 2e4e3906b1 you-still-use-that??: help deprecating commands for removal
2: 43eb8ec0a8 ! 2: 622456481b whatchanged: require --i-still-use-this
@@ Commit message
While at it, update the documentation page to use the new [synopsis]
facility to mark-up the SYNOPSIS part.
+ Two test scripts on fast-import run "git whatchanged" without even
+ checking the output from it. It might still help manual debugging
+ so I've replaced these calls with "git log --raw", but we probably
+ are better off removing such useless git operations that do not
+ contribute to the tests. Such a clean-up is left outside the scope
+ of this patch.
+
Signed-off-by: Junio C Hamano <gitster@pobox.com>
## Documentation/git-whatchanged.adoc ##
@@ t/t4013-diff-various.sh: diff-tree --stat --compact-summary initial mode
test_expect_success 'log -m matches pure log' '
git log master >result &&
process_diffs result >expected &&
+
+ ## t/t4202-log.sh ##
+@@ t/t4202-log.sh: for cmd in show whatchanged reflog format-patch
+ do
+ case "$cmd" in
+ format-patch) myarg="HEAD~.." ;;
++ whatchanged) myarg=--i-still-use-this ;;
+ *) myarg= ;;
+ esac
+
+@@ t/t4202-log.sh: test_expect_success 'reflog is expected format' '
+ '
+
+ test_expect_success 'whatchanged is expected format' '
++ whatchanged="whatchanged --i-still-use-this" &&
+ git log --no-merges --raw >expect &&
+- git whatchanged >actual &&
++ git $whatchanged >actual &&
+ test_cmp expect actual
+ '
+
+ test_expect_success 'log.abbrevCommit configuration' '
++ whatchanged="whatchanged --i-still-use-this" &&
++
+ git log --abbrev-commit >expect.log.abbrev &&
+ git log --no-abbrev-commit >expect.log.full &&
+ git log --pretty=raw >expect.log.raw &&
+ git reflog --abbrev-commit >expect.reflog.abbrev &&
+ git reflog --no-abbrev-commit >expect.reflog.full &&
+- git whatchanged --abbrev-commit >expect.whatchanged.abbrev &&
+- git whatchanged --no-abbrev-commit >expect.whatchanged.full &&
++ git $whatchanged --abbrev-commit >expect.whatchanged.abbrev &&
++ git $whatchanged --no-abbrev-commit >expect.whatchanged.full &&
+
+ test_config log.abbrevCommit true &&
+
+@@ t/t4202-log.sh: test_expect_success 'log.abbrevCommit configuration' '
+ git reflog --no-abbrev-commit >actual &&
+ test_cmp expect.reflog.full actual &&
+
+- git whatchanged >actual &&
++ git $whatchanged >actual &&
+ test_cmp expect.whatchanged.abbrev actual &&
+- git whatchanged --no-abbrev-commit >actual &&
++ git $whatchanged --no-abbrev-commit >actual &&
+ test_cmp expect.whatchanged.full actual
+ '
+
+
+ ## t/t9300-fast-import.sh ##
+@@ t/t9300-fast-import.sh: test_expect_success 'A: create pack from stdin' '
+
+ INPUT_END
+ git fast-import --export-marks=marks.out <input &&
+- git whatchanged main
++ git log --raw main
+ '
+
+ test_expect_success 'A: verify pack' '
+@@ t/t9300-fast-import.sh: test_expect_success 'A: verify marks import does not crash' '
+ INPUT_END
+
+ git fast-import --import-marks=marks.out <input &&
+- git whatchanged verify--import-marks
++ git log --raw verify--import-marks
+ '
+
+ test_expect_success 'A: verify pack' '
+@@ t/t9300-fast-import.sh: test_expect_success 'C: incremental import create pack from stdin' '
+ INPUT_END
+
+ git fast-import <input &&
+- git whatchanged branch
++ git log --raw branch
+ '
+
+ test_expect_success 'C: verify pack' '
+@@ t/t9300-fast-import.sh: test_expect_success 'D: inline data in commit' '
+ INPUT_END
+
+ git fast-import <input &&
+- git whatchanged branch
++ git log --raw branch
+ '
+
+ test_expect_success 'D: verify pack' '
+@@ t/t9300-fast-import.sh: test_expect_success 'H: deletall, add 1' '
+
+ INPUT_END
+ git fast-import <input &&
+- git whatchanged H
++ git log --raw H
+ '
+
+ test_expect_success 'H: verify pack' '
+@@ t/t9300-fast-import.sh: test_expect_success 'Q: commit notes' '
+ INPUT_END
+
+ git fast-import <input &&
+- git whatchanged notes-test
++ git log --raw notes-test
+ '
+
+ test_expect_success 'Q: verify pack' '
+
+ ## t/t9301-fast-import-notes.sh ##
+@@ t/t9301-fast-import-notes.sh: INPUT_END
+ test_expect_success 'set up main branch' '
+
+ git fast-import <input &&
+- git whatchanged main
++ git log --raw main
+ '
+
+ commit4=$(git rev-parse refs/heads/main)
--
2.49.0-599-gc9a5c860a0
next prev parent reply other threads:[~2025-05-01 23:00 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-01 21:34 [PATCH 0/2] Nominating "whatchanged" for removal Junio C Hamano
2025-05-01 21:34 ` [PATCH 1/2] you-still-use-that??: help deprecating commands " Junio C Hamano
2025-05-01 21:34 ` [PATCH 2/2] whatchanged: require --i-still-use-this Junio C Hamano
2025-05-01 22:23 ` Junio C Hamano
2025-05-01 22:59 ` Junio C Hamano [this message]
2025-05-01 22:59 ` [PATCH v2 1/2] you-still-use-that??: help deprecating commands for removal Junio C Hamano
2025-05-01 22:59 ` [PATCH v2 2/2] whatchanged: require --i-still-use-this Junio C Hamano
2025-05-02 9:08 ` Patrick Steinhardt
2025-05-02 16:49 ` Junio C Hamano
2025-05-05 6:10 ` Patrick Steinhardt
2025-05-02 9:08 ` [PATCH v2 0/2] Nominating "whatchanged" for removal Patrick Steinhardt
2025-05-02 16:46 ` Junio C Hamano
2025-05-03 0:58 ` [PATCH v3 0/6] " Junio C Hamano
2025-05-03 0:58 ` [PATCH v3 1/6] you-still-use-that??: help deprecating commands " Junio C Hamano
2025-05-12 17:35 ` Elijah Newren
2025-05-03 0:58 ` [PATCH v3 2/6] doc: prepare for a world without whatchanged Junio C Hamano
2025-05-12 17:36 ` Elijah Newren
2025-05-03 0:58 ` [PATCH v3 3/6] tests: " Junio C Hamano
2025-05-05 6:56 ` Patrick Steinhardt
2025-05-12 17:36 ` Elijah Newren
2025-05-03 0:58 ` [PATCH v3 4/6] whatchanged: require --i-still-use-this Junio C Hamano
2025-05-05 6:56 ` Patrick Steinhardt
2025-05-05 20:49 ` Junio C Hamano
2025-05-03 0:58 ` [PATCH v3 5/6] whatchanged: remove when built with WITH_BREAKING_CHANGES Junio C Hamano
2025-05-05 6:56 ` Patrick Steinhardt
2025-05-05 20:57 ` Junio C Hamano
2025-05-03 0:58 ` [PATCH v3 6/6] whatschanged: list it in BreakingChanges document Junio C Hamano
2025-05-12 17:36 ` Elijah Newren
2025-05-12 18:35 ` Junio C Hamano
2025-05-12 19:03 ` [PATCH v4 0/6] Nominating "whatchanged" for removal Junio C Hamano
2025-05-12 19:03 ` [PATCH v4 1/6] you-still-use-that??: help deprecating commands " Junio C Hamano
2025-05-12 19:03 ` [PATCH v4 2/6] doc: prepare for a world without whatchanged Junio C Hamano
2025-05-12 19:03 ` [PATCH v4 3/6] tests: " Junio C Hamano
2025-05-12 19:03 ` [PATCH v4 4/6] whatchanged: require --i-still-use-this Junio C Hamano
2025-05-14 13:38 ` Junio C Hamano
2025-05-12 19:03 ` [PATCH v4 5/6] whatchanged: remove when built with WITH_BREAKING_CHANGES Junio C Hamano
2025-05-12 19:03 ` [PATCH v4 6/6] whatschanged: list it in BreakingChanges document Junio C Hamano
2025-05-12 21:21 ` [PATCH v4 0/6] Nominating "whatchanged" for removal Elijah Newren
2025-05-12 22:42 ` 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=20250501225958.2947677-1-gitster@pobox.com \
--to=gitster@pobox.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).