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@xxxxxxxxxxxxxxx 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@xxxxxxxxx> ## 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