Git fork

whatchanged: remove when built with WITH_BREAKING_CHANGES

As we made "git whatchanged" require "--i-still-use-this" and asked
the users to report if they still want to use it, the logical next
step is to allow us build Git without "whatchanged" to prepare for
its eventual removal.

If we were to follow the pattern established in 8ccc75c2 (remote:
announce removal of "branches/" and "remotes/", 2025-01-22), we can
do this together with the documentation update to officially list
that the command will be removed in the BreakingChanges document,
but let's just keep the changes separate just in case we want to
proceed a bit slower.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

+66 -15
+6
Documentation/config/format.adoc
··· 68 68 Defaults to true. 69 69 70 70 format.pretty:: 71 + ifndef::with-breaking-changes[] 71 72 The default pretty format for log/show/whatchanged command. 72 73 See linkgit:git-log[1], linkgit:git-show[1], 73 74 linkgit:git-whatchanged[1]. 75 + endif::with-breaking-changes[] 76 + ifdef::with-breaking-changes[] 77 + The default pretty format for log/show command. 78 + See linkgit:git-log[1], linkgit:git-show[1]. 79 + endif::with-breaking-changes[] 74 80 75 81 format.thread:: 76 82 The default threading style for 'git format-patch'. Can be
+9 -2
Documentation/config/log.adoc
··· 1 1 log.abbrevCommit:: 2 - If true, makes linkgit:git-log[1], linkgit:git-show[1], and 3 - linkgit:git-whatchanged[1] assume `--abbrev-commit`. You may 2 + If true, makes 3 + ifndef::with-breaking-changes[] 4 + linkgit:git-log[1], linkgit:git-show[1], and 5 + linkgit:git-whatchanged[1] 6 + endif::with-breaking-changes[] 7 + ifdef::with-breaking-changes[] 8 + linkgit:git-log[1] and linkgit:git-show[1] 9 + endif::with-breaking-changes[] 10 + assume `--abbrev-commit`. You may 4 11 override this option with `--no-abbrev-commit`. 5 12 6 13 log.date::
+5
Documentation/pretty-options.adoc
··· 62 62 --notes[=<ref>]:: 63 63 Show the notes (see linkgit:git-notes[1]) that annotate the 64 64 commit, when showing the commit log message. This is the default 65 + ifndef::with-breaking-changes[] 65 66 for `git log`, `git show` and `git whatchanged` commands when 67 + endif::with-breaking-changes[] 68 + ifdef::with-breaking-changes[] 69 + for `git log` and `git show` commands when 70 + endif::with-breaking-changes[] 66 71 there is no `--pretty`, `--format`, or `--oneline` option given 67 72 on the command line. 68 73 +
+7 -2
Documentation/rev-list-options.adoc
··· 1074 1074 1075 1075 ifdef::git-rev-list[] 1076 1076 Using these options, linkgit:git-rev-list[1] will act similar to the 1077 - more specialized family of commit log tools: linkgit:git-log[1], 1078 - linkgit:git-show[1], and linkgit:git-whatchanged[1] 1077 + more specialized family of commit log tools: 1078 + ifndef::with-breaking-changes[] 1079 + linkgit:git-log[1], linkgit:git-show[1], and linkgit:git-whatchanged[1]. 1080 + endif::with-breaking-changes[] 1081 + ifdef::with-breaking-changes[] 1082 + linkgit:git-log[1] and linkgit:git-show[1]. 1083 + endif::with-breaking-changes[] 1079 1084 endif::git-rev-list[] 1080 1085 1081 1086 include::pretty-options.adoc[]
+1 -1
Documentation/technical/sparse-checkout.adoc
··· 442 442 * blame (only matters when one or more -C flags are passed) 443 443 * and annotate 444 444 * log 445 - * whatchanged 445 + * whatchanged (may not exist anymore) 446 446 * ls-files 447 447 * diff-index 448 448 * diff-tree
+6
builtin/log.c
··· 114 114 char *fmt_pretty; 115 115 char *default_date_mode; 116 116 117 + #ifndef WITH_BREAKING_CHANGES 117 118 /* 118 119 * Note: git_log_config() does not touch this member and that 119 120 * is very deliberate. This member is only to be used to 120 121 * resurrect whatchanged that is deprecated. 121 122 */ 122 123 int i_still_use_this; 124 + #endif 123 125 }; 124 126 125 127 static void log_config_init(struct log_config *cfg) ··· 274 276 OPT__QUIET(&quiet, N_("suppress diff output")), 275 277 OPT_BOOL(0, "source", &source, N_("show source")), 276 278 OPT_BOOL(0, "use-mailmap", &mailmap, N_("use mail map file")), 279 + #ifndef WITH_BREAKING_CHANGES 277 280 OPT_HIDDEN_BOOL(0, "i-still-use-this", &cfg->i_still_use_this, 278 281 "<use this deprecated command>"), 282 + #endif 279 283 OPT_ALIAS(0, "mailmap", "use-mailmap"), 280 284 OPT_CALLBACK_F(0, "clear-decorations", NULL, NULL, 281 285 N_("clear all previously-defined decoration filters"), ··· 642 646 return git_diff_ui_config(var, value, ctx, cb); 643 647 } 644 648 649 + #ifndef WITH_BREAKING_CHANGES 645 650 int cmd_whatchanged(int argc, 646 651 const char **argv, 647 652 const char *prefix, ··· 678 683 log_config_release(&cfg); 679 684 return ret; 680 685 } 686 + #endif 681 687 682 688 static void show_tagger(const char *buf, struct rev_info *rev) 683 689 {
+2
git.c
··· 645 645 { "verify-pack", cmd_verify_pack }, 646 646 { "verify-tag", cmd_verify_tag, RUN_SETUP }, 647 647 { "version", cmd_version }, 648 + #ifndef WITH_BREAKING_CHANGES 648 649 { "whatchanged", cmd_whatchanged, RUN_SETUP }, 650 + #endif 649 651 { "worktree", cmd_worktree, RUN_SETUP }, 650 652 { "write-tree", cmd_write_tree, RUN_SETUP }, 651 653 };
+10 -2
t/t4013-diff-various.sh
··· 200 200 expect="$TEST_DIRECTORY/t4013/diff.$test" 201 201 actual="$pfx-diff.$test" 202 202 203 - test_expect_success "git $cmd # magic is ${magic:-(not used)}" ' 203 + case "$cmd" in 204 + whatchanged | whatchanged" "*) 205 + prereq=WITHOUT_BREAKING_CHANGES 206 + ;; 207 + *) 208 + prereq=;; 209 + esac 210 + 211 + test_expect_success $prereq "git $cmd # magic is ${magic:-(not used)}" ' 204 212 { 205 213 echo "$ git $cmd" 206 214 ··· 462 470 diff-tree -R --stat --compact-summary initial mode 463 471 EOF 464 472 465 - test_expect_success 'whatchanged needs --i-still-use-this' ' 473 + test_expect_success WITHOUT_BREAKING_CHANGES 'whatchanged needs --i-still-use-this' ' 466 474 test_must_fail git whatchanged >message 2>&1 && 467 475 test_grep "nominated for removal" message 468 476 '
+20 -8
t/t4202-log.sh
··· 486 486 ) 487 487 ' 488 488 489 - for cmd in show whatchanged reflog format-patch 489 + cmds="show reflog format-patch" 490 + if test_have_prereq WITHOUT_BREAKING_CHANGES 491 + then 492 + cmds="$cmds whatchanged" 493 + fi 494 + for cmd in $cmds 490 495 do 491 496 case "$cmd" in 492 497 format-patch) myarg="HEAD~.." ;; ··· 1202 1207 test_cmp expect actual 1203 1208 ' 1204 1209 1205 - test_expect_success 'whatchanged is expected format' ' 1210 + test_expect_success WITHOUT_BREAKING_CHANGES 'whatchanged is expected format' ' 1206 1211 whatchanged="whatchanged --i-still-use-this" && 1207 1212 git log --no-merges --raw >expect && 1208 1213 git $whatchanged >actual && ··· 1217 1222 git log --pretty=raw >expect.log.raw && 1218 1223 git reflog --abbrev-commit >expect.reflog.abbrev && 1219 1224 git reflog --no-abbrev-commit >expect.reflog.full && 1220 - git $whatchanged --abbrev-commit >expect.whatchanged.abbrev && 1221 - git $whatchanged --no-abbrev-commit >expect.whatchanged.full && 1225 + 1226 + if test_have_prereq WITHOUT_BREAKING_CHANGES 1227 + then 1228 + git $whatchanged --abbrev-commit >expect.whatchanged.abbrev && 1229 + git $whatchanged --no-abbrev-commit >expect.whatchanged.full 1230 + fi && 1222 1231 1223 1232 test_config log.abbrevCommit true && 1224 1233 ··· 1235 1244 git reflog --no-abbrev-commit >actual && 1236 1245 test_cmp expect.reflog.full actual && 1237 1246 1238 - git $whatchanged >actual && 1239 - test_cmp expect.whatchanged.abbrev actual && 1240 - git $whatchanged --no-abbrev-commit >actual && 1241 - test_cmp expect.whatchanged.full actual 1247 + if test_have_prereq WITHOUT_BREAKING_CHANGES 1248 + then 1249 + git $whatchanged >actual && 1250 + test_cmp expect.whatchanged.abbrev actual && 1251 + git $whatchanged --no-abbrev-commit >actual && 1252 + test_cmp expect.whatchanged.full actual 1253 + fi 1242 1254 ' 1243 1255 1244 1256 test_expect_success '--abbrev-commit with core.abbrev=false' '