git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/2] Nominating "whatchanged" for removal

From
Junio C Hamano <gitster@pobox.com>
Date
May 1, 2025, 22:59 UTC
Message-ID
<20250501225958.2947677-1-gitster@pobox.com>
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
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 39 in “Nominating "whatchanged" for removal”
  1. 0/2 Nominating "whatchanged" for removalJunio C Hamano, May 1, 2025
  2. 1/2 you-still-use-that??: help deprecating commands for removalJunio C Hamano, May 1, 2025
  3. 2/2 whatchanged: require --i-still-use-thisJunio C Hamano, May 1, 2025
  4. Junio C HamanoMay 1, 2025
  5. 0/2 Nominating "whatchanged" for removalJunio C Hamano, May 1, 2025
  6. 1/2 you-still-use-that??: help deprecating commands for removalJunio C Hamano, May 1, 2025
  7. 2/2 whatchanged: require --i-still-use-thisJunio C Hamano, May 1, 2025
  8. Patrick SteinhardtMay 2, 2025
  9. Junio C HamanoMay 2, 2025
  10. Patrick SteinhardtMay 5, 2025
  11. Patrick SteinhardtMay 2, 2025
  12. Junio C HamanoMay 2, 2025
  13. 0/6 Nominating "whatchanged" for removalJunio C Hamano, May 3, 2025
  14. 1/6 you-still-use-that??: help deprecating commands for removalJunio C Hamano, May 3, 2025
  15. Elijah NewrenMay 12, 2025
  16. 2/6 doc: prepare for a world without whatchangedJunio C Hamano, May 3, 2025
  17. Elijah NewrenMay 12, 2025
  18. 3/6 tests: prepare for a world without whatchangedJunio C Hamano, May 3, 2025
  19. Patrick SteinhardtMay 5, 2025
  20. Elijah NewrenMay 12, 2025
  21. 4/6 whatchanged: require --i-still-use-thisJunio C Hamano, May 3, 2025
  22. Patrick SteinhardtMay 5, 2025
  23. Junio C HamanoMay 5, 2025
  24. 5/6 whatchanged: remove when built with WITH_BREAKING_CHANGESJunio C Hamano, May 3, 2025
  25. Patrick SteinhardtMay 5, 2025
  26. Junio C HamanoMay 5, 2025
  27. 6/6 whatschanged: list it in BreakingChanges documentJunio C Hamano, May 3, 2025
  28. Elijah NewrenMay 12, 2025
  29. Junio C HamanoMay 12, 2025
  30. 0/6 Nominating "whatchanged" for removalJunio C Hamano, May 12, 2025
  31. 1/6 you-still-use-that??: help deprecating commands for removalJunio C Hamano, May 12, 2025
  32. 2/6 doc: prepare for a world without whatchangedJunio C Hamano, May 12, 2025
  33. 3/6 tests: prepare for a world without whatchangedJunio C Hamano, May 12, 2025
  34. 4/6 whatchanged: require --i-still-use-thisJunio C Hamano, May 12, 2025
  35. Junio C HamanoMay 14, 2025
  36. 5/6 whatchanged: remove when built with WITH_BREAKING_CHANGESJunio C Hamano, May 12, 2025
  37. 6/6 whatschanged: list it in BreakingChanges documentJunio C Hamano, May 12, 2025
  38. Elijah NewrenMay 12, 2025
  39. Junio C HamanoMay 12, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.