{"thread":{"id":"62577","subject":"[PATCH] Revert \"doc: move git-cherry to plumbing\"","startedAt":"2024-11-30T13:28:01Z","lastAt":"2024-11-30T13:28:01Z","messageCount":1,"participants":["kristofferhaugsbakk@fastmail.com"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"508377","messageId":"e5b20f9ceb437a82c422136cb81b05a0521cab07.1732973210.git.code@khaugsbakk.name","threadId":"62577","inReplyTo":null,"subject":"[PATCH] Revert \"doc: move git-cherry to plumbing\"","fromName":"","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2024-11-30T13:27:41Z","receivedAt":"2024-11-30T13:28:01Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"From: Kristoffer Haugsbakk <code@khaugsbakk.name>\n\nThis reverts commit 61018fe9e005a54e18184481927519d64035220a.\n\ngit-cherry(1) is a high level command for checking what commits have and\nhave not been applied to some other branch.  Or at least as high level\nas the git(1) suite offers.  In other words:\n\n• it is a useful interrogator for a particular workflow; and\n• there are no higher level commands on offer.\n\nBy contrast its use for scripting is somewhat narrow since it only\nprints the patch application status and the hashes of the downstream\nbranch (not also the upstream branch equivalents).  git-patch-id(1)\ngives a fuller picture by printing each hash and its corresponding\npatch id.\n\nNow this command is not nearly as convenient for the purpose of deleting\na *merged* branch as:\n\n    git branch -d <branch>\n\nSince that command will refuse to delete the branch if the commits are\nnot in the configured upstream ref.  But again it is the most convenient\ncommand for the patch workflow.\n\nThis command might only be considered plumbing by way of the plumbing\ncontract that says that plumbing commands have stable output.  But\nhopefully listing this command as Porcelain does not give the impression\nthat the output is not stable.  Output stability was in any case not the\nmotivation for moving this command to plumbing.\n\nUsers who need this interrogator should not have to look down in the\nplumbing section in order to find it.\n\nThis also reverts its removal from Bash completion which Duy Nguyen\nreported as a regression.[1]  The correct change for that plumbing move\nwould apparently have been to remove the `complete` category.\n\n[1]: https://lore.kernel.org/git/CACsJy8AVGbS_NTZsUj_hD9D+t4YV1_S4KTD25Kda85syvoowyg@mail.gmail.com/\n\nReported-by: Duy Nguyen <pclouds@gmail.com>\nSigned-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>\n---\n\nNotes (series):\n    The `---` comment on the patch:\n    \n    > Up to discussion whether cherry should be considered plumbing.\n    > I lean towards considering it a rarely-used porcelain command, but\n    > a case could be made either way so let's see what the list thinks.\n    \n    I don’t know why rarely-used is relevant.  This change now lists\n    git-cherry(1) down in the (Porcelain) Interrogators section, along with\n    commands such as:\n    \n    • git-bugreport(1)\n    • git-count-objects(1)\n    • git-diagnose(1)\n    • git-whatchanged(1)\n    \n    Not everyday tools.  And that’s okay.\n\n command-list.txt                       |  2 +-\n contrib/completion/git-completion.bash | 11 +++++++++++\n 2 files changed, 12 insertions(+), 1 deletion(-)\n\ndiff --git a/command-list.txt b/command-list.txt\nindex e0bb87b3b5c..d73c8f59e63 100644\n--- a/command-list.txt\n+++ b/command-list.txt\n@@ -72,7 +72,7 @@ git-check-mailmap                       purehelpers\n git-check-ref-format                    purehelpers\n git-checkout                            mainporcelain\n git-checkout-index                      plumbingmanipulators\n-git-cherry                              plumbinginterrogators          complete\n+git-cherry                              ancillaryinterrogators          complete\n git-cherry-pick                         mainporcelain\n git-citool                              mainporcelain\n git-clean                               mainporcelain\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 3d4dff3185c..5026ef595cd 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1746,6 +1746,17 @@ _git_checkout ()\n \n __git_sequencer_inprogress_options=\"--continue --quit --abort --skip\"\n \n+_git_cherry ()\n+{\n+\tcase \"$cur\" in\n+\t--*)\n+\t\t__gitcomp_builtin cherry\n+\t\treturn\n+\tesac\n+\n+\t__git_complete_refs\n+}\n+\n __git_cherry_pick_inprogress_options=$__git_sequencer_inprogress_options\n \n _git_cherry_pick ()\n\nbase-commit: cc01bad4a9f566cf4453c7edd6b433851b0835e2\n-- \n2.47.0\n\n"}]}