{"thread":{"id":"56089","subject":"[PATCH v2 0/2] extra: new concept of extra components","startedAt":"2021-07-10T23:49:03Z","lastAt":"2021-07-16T20:14:34Z","messageCount":17,"participants":["Felipe Contreras","Philippe Blain","Junio C Hamano","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"429652","messageId":"20210710234629.17197-1-felipe.contreras@gmail.com","threadId":"56089","inReplyTo":null,"subject":"[PATCH v2 0/2] extra: new concept of extra components","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-10T23:46:27Z","receivedAt":"2021-07-10T23:49:03Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"This patch series introduces the concept of extra components. These are\ncomponents which are not yet part of the core but are good enough for\ndistributions to ship, and in fact, they already do.\n\nThis benefits everyone:\n\n 1. Distribution packagers that just want to do `make install`\n 2. People who download git's source code and just want to do\n    `make install`\n 3. Developers who have no idea what's production-level quality in\n    contrib/ and just want to do `make install`.\n\nFor now they'll have to do `make install install-extra`. But if the\nresult is deemed correct, we might choose to add \"install-extra\" to the\n\"install\" target.\n\nThe measuring stick I'm using to gauge if a component in contrib belongs\nin extra is simple: are we already running tests for them with\n'make test'? If the answer is \"yes, we do run tests\", then the answer is\n\"yes, it belongs in contrib\".\n\nWe might want to move more components from contrib to extra once their\ntests are being run reliably.\n\nAnd we might move some components from the core which aren't really part\nof the core to extra, like gitk, git-gui, git-p4, and git-svn.\n\nFor now only contrib/completion and contrib/workdir are graduated to the\nnew area.\n\nSince v1 I removed extra/Makefile in favor having the targets in the\ntop-level Makfile as Ævar suggested.\n\nFelipe Contreras (2):\n  completion: graduate out of contrib\n  git-new-workdir: graduate out of contrib\n\n Makefile                                          | 13 +++++++++++++\n {contrib => extra}/completion/git-completion.bash |  0\n {contrib => extra}/completion/git-completion.zsh  |  0\n {contrib => extra}/completion/git-prompt.sh       |  0\n {contrib => extra}/workdir/.gitattributes         |  0\n {contrib => extra}/workdir/git-new-workdir        |  0\n t/t1021-rerere-in-workdir.sh                      |  6 +++---\n t/t3000-ls-files-others.sh                        |  2 +-\n t/t9902-completion.sh                             |  8 ++++----\n t/t9903-bash-prompt.sh                            |  2 +-\n 10 files changed, 22 insertions(+), 9 deletions(-)\n rename {contrib => extra}/completion/git-completion.bash (100%)\n rename {contrib => extra}/completion/git-completion.zsh (100%)\n rename {contrib => extra}/completion/git-prompt.sh (100%)\n rename {contrib => extra}/workdir/.gitattributes (100%)\n rename {contrib => extra}/workdir/git-new-workdir (100%)\n\nRange-diff against v1:\n1:  3a2c2402af ! 1:  3f44bc3253 completion: graduate out of contrib\n    @@ Commit message\n         Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n     \n      ## Makefile ##\n    +@@ Makefile: sharedir = $(prefix)/share\n    + gitwebdir = $(sharedir)/gitweb\n    + perllibdir = $(sharedir)/perl5\n    + localedir = $(sharedir)/locale\n    ++bashcompdir = $(sharedir)/bash-completion/completions\n    + template_dir = share/git-core/templates\n    + htmldir = $(prefix)/share/doc/git-doc\n    + ETC_GITCONFIG = $(sysconfdir)/gitconfig\n    +@@ Makefile: bindir_relative_SQ = $(subst ','\\'',$(bindir_relative))\n    + mandir_SQ = $(subst ','\\'',$(mandir))\n    + mandir_relative_SQ = $(subst ','\\'',$(mandir_relative))\n    + infodir_relative_SQ = $(subst ','\\'',$(infodir_relative))\n    ++sharedir_SQ = $(subst ','\\'',$(sharedir))\n    + perllibdir_SQ = $(subst ','\\'',$(perllibdir))\n    + localedir_SQ = $(subst ','\\'',$(localedir))\n    + localedir_relative_SQ = $(subst ','\\'',$(localedir_relative))\n    +@@ Makefile: htmldir_relative_SQ = $(subst ','\\'',$(htmldir_relative))\n    + prefix_SQ = $(subst ','\\'',$(prefix))\n    + perllibdir_relative_SQ = $(subst ','\\'',$(perllibdir_relative))\n    + gitwebdir_SQ = $(subst ','\\'',$(gitwebdir))\n    ++bashcompdir_SQ = $(subst ','\\'',$(bashcompdir))\n    + \n    + SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n    + TEST_SHELL_PATH_SQ = $(subst ','\\'',$(TEST_SHELL_PATH))\n     @@ Makefile: quick-install-man:\n      quick-install-html:\n      \t$(MAKE) -C Documentation quick-install-html\n      \n    -+install-extra:\n    -+\t$(MAKE) -C extra install\n    ++install-extra: install-completion\n    ++\n    ++install-completion:\n    ++\t$(INSTALL) -D -m 644 extra/completion/git-completion.bash '$(DESTDIR_SQ)$(bashcompdir_SQ)'/git\n    ++\t$(INSTALL) -D -m 644 extra/completion/git-prompt.sh '$(DESTDIR_SQ)$(sharedir_SQ)'/git-core/git-prompt.sh\n    ++\t$(INSTALL) -D -m 644 extra/completion/git-completion.zsh '$(DESTDIR_SQ)$(sharedir_SQ)'/zsh/site-functions/_git\n     +\n      \n      \n      ### Maintainer's dist rules\n     \n    - ## extra/Makefile (new) ##\n    -@@\n    -+bashcompdir = $(sharedir)/bash-completion/completions\n    -+\n    -+DESTDIR_SQ = $(subst ','\\'',$(DESTDIR))\n    -+sharedir_SQ = $(subst ','\\'',$(sharedir))\n    -+bashcompdir_SQ = $(subst ','\\'',$(bashcompdir))\n    -+gitexec_instdir_SQ = $(subst ','\\'',$(gitexec_instdir))\n    -+\n    -+INSTALL ?= install\n    -+\n    -+all:\n    -+\n    -+install: install-completion\n    -+\n    -+install-completion:\n    -+\t$(INSTALL) -D -m 644 completion/git-completion.bash '$(DESTDIR_SQ)$(bashcompdir_SQ)'/git\n    -+\t$(INSTALL) -D -m 644 completion/git-prompt.sh '$(DESTDIR_SQ)$(sharedir_SQ)'/git-core/git-prompt.sh\n    -+\t$(INSTALL) -D -m 644 completion/git-completion.zsh '$(DESTDIR_SQ)$(sharedir_SQ)'/zsh/site-functions/_git\n    -\n      ## contrib/completion/git-completion.bash => extra/completion/git-completion.bash ##\n     \n      ## contrib/completion/git-completion.zsh => extra/completion/git-completion.zsh ##\n2:  81836329cd ! 2:  af9b24eeb1 git-new-workdir: graduate out of contrib\n    @@ Commit message\n     \n         Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n     \n    - ## extra/Makefile ##\n    -@@ extra/Makefile: INSTALL ?= install\n    + ## Makefile ##\n    +@@ Makefile: quick-install-man:\n    + quick-install-html:\n    + \t$(MAKE) -C Documentation quick-install-html\n      \n    - all:\n    - \n    --install: install-completion\n    -+install: install-completion install-workdir\n    +-install-extra: install-completion\n    ++install-extra: install-completion install-workdir\n      \n      install-completion:\n    - \t$(INSTALL) -D -m 644 completion/git-completion.bash '$(DESTDIR_SQ)$(bashcompdir_SQ)'/git\n    - \t$(INSTALL) -D -m 644 completion/git-prompt.sh '$(DESTDIR_SQ)$(sharedir_SQ)'/git-core/git-prompt.sh\n    - \t$(INSTALL) -D -m 644 completion/git-completion.zsh '$(DESTDIR_SQ)$(sharedir_SQ)'/zsh/site-functions/_git\n    -+\n    + \t$(INSTALL) -D -m 644 extra/completion/git-completion.bash '$(DESTDIR_SQ)$(bashcompdir_SQ)'/git\n    + \t$(INSTALL) -D -m 644 extra/completion/git-prompt.sh '$(DESTDIR_SQ)$(sharedir_SQ)'/git-core/git-prompt.sh\n    + \t$(INSTALL) -D -m 644 extra/completion/git-completion.zsh '$(DESTDIR_SQ)$(sharedir_SQ)'/zsh/site-functions/_git\n    + \n     +install-workdir:\n    -+\t$(INSTALL) -D workdir/git-new-workdir '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'/git-new-workdir\n    ++\t$(INSTALL) -D extra/workdir/git-new-workdir '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'/git-new-workdir\n    ++\n    + \n    + \n    + ### Maintainer's dist rules\n     \n      ## contrib/workdir/.gitattributes => extra/workdir/.gitattributes ##\n     \n-- \n2.32.0.36.g70aac2b1aa\n\n"},{"id":"429653","messageId":"20210710234629.17197-2-felipe.contreras@gmail.com","threadId":"56089","inReplyTo":"20210710234629.17197-1-felipe.contreras@gmail.com","subject":"[PATCH v2 1/2] completion: graduate out of contrib","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-10T23:46:28Z","receivedAt":"2021-07-10T23:49:03Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"These have been stable and widely used for quite a long time, they even\nhave tests outside of the contrib area, and most distributions ship\nthem, so they can be considered part of the core already.\n\nWe should be consistent and either we move the tests to contrib, or we\nmove the completions out of contrib.\n\nLet's move them out of contrib and provide an installation target\ninstall-extra.\n\nBy default bash-completion installs the completions to\n$(pkgdatadir)/completions, which is\n$(prefix)/share/bash-completion/completions. And since most distributions do\nnot change this, it is obviously the right default that distributions\ncan override with bashcompdir.\n\nBy default zsh looks for completions in\n$(prefix)/share/zsh/site-functions.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile                                          | 10 ++++++++++\n {contrib => extra}/completion/git-completion.bash |  0\n {contrib => extra}/completion/git-completion.zsh  |  0\n {contrib => extra}/completion/git-prompt.sh       |  0\n t/t9902-completion.sh                             |  8 ++++----\n t/t9903-bash-prompt.sh                            |  2 +-\n 6 files changed, 15 insertions(+), 5 deletions(-)\n rename {contrib => extra}/completion/git-completion.bash (100%)\n rename {contrib => extra}/completion/git-completion.zsh (100%)\n rename {contrib => extra}/completion/git-prompt.sh (100%)\n\ndiff --git a/Makefile b/Makefile\nindex 502e0c9a81..0a13e5f077 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -532,6 +532,7 @@ sharedir = $(prefix)/share\n gitwebdir = $(sharedir)/gitweb\n perllibdir = $(sharedir)/perl5\n localedir = $(sharedir)/locale\n+bashcompdir = $(sharedir)/bash-completion/completions\n template_dir = share/git-core/templates\n htmldir = $(prefix)/share/doc/git-doc\n ETC_GITCONFIG = $(sysconfdir)/gitconfig\n@@ -2015,6 +2016,7 @@ bindir_relative_SQ = $(subst ','\\'',$(bindir_relative))\n mandir_SQ = $(subst ','\\'',$(mandir))\n mandir_relative_SQ = $(subst ','\\'',$(mandir_relative))\n infodir_relative_SQ = $(subst ','\\'',$(infodir_relative))\n+sharedir_SQ = $(subst ','\\'',$(sharedir))\n perllibdir_SQ = $(subst ','\\'',$(perllibdir))\n localedir_SQ = $(subst ','\\'',$(localedir))\n localedir_relative_SQ = $(subst ','\\'',$(localedir_relative))\n@@ -2025,6 +2027,7 @@ htmldir_relative_SQ = $(subst ','\\'',$(htmldir_relative))\n prefix_SQ = $(subst ','\\'',$(prefix))\n perllibdir_relative_SQ = $(subst ','\\'',$(perllibdir_relative))\n gitwebdir_SQ = $(subst ','\\'',$(gitwebdir))\n+bashcompdir_SQ = $(subst ','\\'',$(bashcompdir))\n \n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n TEST_SHELL_PATH_SQ = $(subst ','\\'',$(TEST_SHELL_PATH))\n@@ -3112,6 +3115,13 @@ quick-install-man:\n quick-install-html:\n \t$(MAKE) -C Documentation quick-install-html\n \n+install-extra: install-completion\n+\n+install-completion:\n+\t$(INSTALL) -D -m 644 extra/completion/git-completion.bash '$(DESTDIR_SQ)$(bashcompdir_SQ)'/git\n+\t$(INSTALL) -D -m 644 extra/completion/git-prompt.sh '$(DESTDIR_SQ)$(sharedir_SQ)'/git-core/git-prompt.sh\n+\t$(INSTALL) -D -m 644 extra/completion/git-completion.zsh '$(DESTDIR_SQ)$(sharedir_SQ)'/zsh/site-functions/_git\n+\n \n \n ### Maintainer's dist rules\ndiff --git a/contrib/completion/git-completion.bash b/extra/completion/git-completion.bash\nsimilarity index 100%\nrename from contrib/completion/git-completion.bash\nrename to extra/completion/git-completion.bash\ndiff --git a/contrib/completion/git-completion.zsh b/extra/completion/git-completion.zsh\nsimilarity index 100%\nrename from contrib/completion/git-completion.zsh\nrename to extra/completion/git-completion.zsh\ndiff --git a/contrib/completion/git-prompt.sh b/extra/completion/git-prompt.sh\nsimilarity index 100%\nrename from contrib/completion/git-prompt.sh\nrename to extra/completion/git-prompt.sh\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex cb057ef161..32601b755d 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -36,7 +36,7 @@ complete ()\n GIT_TESTING_ALL_COMMAND_LIST='add checkout check-attr rebase ls-files'\n GIT_TESTING_PORCELAIN_COMMAND_LIST='add checkout rebase'\n \n-. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\"\n+. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\"\n \n # We don't need this function to actually join words or do anything special.\n # Also, it's cleaner to avoid touching bash's internal completion variables.\n@@ -2383,14 +2383,14 @@ test_expect_success 'git clone --config= - value' '\n test_expect_success 'sourcing the completion script clears cached commands' '\n \t__git_compute_all_commands &&\n \tverbose test -n \"$__git_all_commands\" &&\n-\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n+\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n \tverbose test -z \"$__git_all_commands\"\n '\n \n test_expect_success 'sourcing the completion script clears cached merge strategies' '\n \t__git_compute_merge_strategies &&\n \tverbose test -n \"$__git_merge_strategies\" &&\n-\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n+\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n \tverbose test -z \"$__git_merge_strategies\"\n '\n \n@@ -2399,7 +2399,7 @@ test_expect_success 'sourcing the completion script clears cached --options' '\n \tverbose test -n \"$__gitcomp_builtin_checkout\" &&\n \t__gitcomp_builtin notes_edit &&\n \tverbose test -n \"$__gitcomp_builtin_notes_edit\" &&\n-\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n+\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n \tverbose test -z \"$__gitcomp_builtin_checkout\" &&\n \tverbose test -z \"$__gitcomp_builtin_notes_edit\"\n '\ndiff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\nindex bbd513bab0..784e523fd4 100755\n--- a/t/t9903-bash-prompt.sh\n+++ b/t/t9903-bash-prompt.sh\n@@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./lib-bash.sh\n \n-. \"$GIT_BUILD_DIR/contrib/completion/git-prompt.sh\"\n+. \"$GIT_BUILD_DIR/extra/completion/git-prompt.sh\"\n \n actual=\"$TRASH_DIRECTORY/actual\"\n c_red='\\\\[\\\\e[31m\\\\]'\n-- \n2.32.0.36.g70aac2b1aa\n\n"},{"id":"429654","messageId":"20210710234629.17197-3-felipe.contreras@gmail.com","threadId":"56089","inReplyTo":"20210710234629.17197-1-felipe.contreras@gmail.com","subject":"[PATCH v2 2/2] git-new-workdir: graduate out of contrib","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-10T23:46:29Z","receivedAt":"2021-07-10T23:49:03Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile                                   | 5 ++++-\n {contrib => extra}/workdir/.gitattributes  | 0\n {contrib => extra}/workdir/git-new-workdir | 0\n t/t1021-rerere-in-workdir.sh               | 6 +++---\n t/t3000-ls-files-others.sh                 | 2 +-\n 5 files changed, 8 insertions(+), 5 deletions(-)\n rename {contrib => extra}/workdir/.gitattributes (100%)\n rename {contrib => extra}/workdir/git-new-workdir (100%)\n\ndiff --git a/Makefile b/Makefile\nindex 0a13e5f077..a03387f8d1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -3115,13 +3115,16 @@ quick-install-man:\n quick-install-html:\n \t$(MAKE) -C Documentation quick-install-html\n \n-install-extra: install-completion\n+install-extra: install-completion install-workdir\n \n install-completion:\n \t$(INSTALL) -D -m 644 extra/completion/git-completion.bash '$(DESTDIR_SQ)$(bashcompdir_SQ)'/git\n \t$(INSTALL) -D -m 644 extra/completion/git-prompt.sh '$(DESTDIR_SQ)$(sharedir_SQ)'/git-core/git-prompt.sh\n \t$(INSTALL) -D -m 644 extra/completion/git-completion.zsh '$(DESTDIR_SQ)$(sharedir_SQ)'/zsh/site-functions/_git\n \n+install-workdir:\n+\t$(INSTALL) -D extra/workdir/git-new-workdir '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'/git-new-workdir\n+\n \n \n ### Maintainer's dist rules\ndiff --git a/contrib/workdir/.gitattributes b/extra/workdir/.gitattributes\nsimilarity index 100%\nrename from contrib/workdir/.gitattributes\nrename to extra/workdir/.gitattributes\ndiff --git a/contrib/workdir/git-new-workdir b/extra/workdir/git-new-workdir\nsimilarity index 100%\nrename from contrib/workdir/git-new-workdir\nrename to extra/workdir/git-new-workdir\ndiff --git a/t/t1021-rerere-in-workdir.sh b/t/t1021-rerere-in-workdir.sh\nindex 0b892894eb..035a92c0e7 100755\n--- a/t/t1021-rerere-in-workdir.sh\n+++ b/t/t1021-rerere-in-workdir.sh\n@@ -27,7 +27,7 @@ test_expect_success SYMLINKS setup '\n \n test_expect_success SYMLINKS 'rerere in workdir' '\n \trm -rf .git/rr-cache &&\n-\t\"$SHELL_PATH\" \"$TEST_DIRECTORY/../contrib/workdir/git-new-workdir\" . work &&\n+\t\"$SHELL_PATH\" \"$TEST_DIRECTORY/../extra/workdir/git-new-workdir\" . work &&\n \t(\n \t\tcd work &&\n \t\ttest_must_fail git merge side &&\n@@ -38,12 +38,12 @@ test_expect_success SYMLINKS 'rerere in workdir' '\n '\n \n # This fails because we don't resolve relative symlink in mkdir_in_gitdir()\n-# For the purpose of helping contrib/workdir/git-new-workdir users, we do not\n+# For the purpose of helping extra/workdir/git-new-workdir users, we do not\n # have to support relative symlinks, but it might be nicer to make this work\n # with a relative symbolic link someday.\n test_expect_failure SYMLINKS 'rerere in workdir (relative)' '\n \trm -rf .git/rr-cache &&\n-\t\"$SHELL_PATH\" \"$TEST_DIRECTORY/../contrib/workdir/git-new-workdir\" . krow &&\n+\t\"$SHELL_PATH\" \"$TEST_DIRECTORY/../extra/workdir/git-new-workdir\" . krow &&\n \t(\n \t\tcd krow &&\n \t\trm -f .git/rr-cache &&\ndiff --git a/t/t3000-ls-files-others.sh b/t/t3000-ls-files-others.sh\nindex 740ce56eab..86240a1b98 100755\n--- a/t/t3000-ls-files-others.sh\n+++ b/t/t3000-ls-files-others.sh\n@@ -84,7 +84,7 @@ test_expect_success SYMLINKS 'ls-files --others with symlinked submodule' '\n \t) &&\n \t(\n \t\tcd super &&\n-\t\t\"$SHELL_PATH\" \"$TEST_DIRECTORY/../contrib/workdir/git-new-workdir\" ../sub sub &&\n+\t\t\"$SHELL_PATH\" \"$TEST_DIRECTORY/../extra/workdir/git-new-workdir\" ../sub sub &&\n \t\tgit ls-files --others --exclude-standard >../actual\n \t) &&\n \techo sub/ >expect &&\n-- \n2.32.0.36.g70aac2b1aa\n\n"},{"id":"429784","messageId":"c530dedb-8cad-2a73-5b56-a32173046382@gmail.com","threadId":"56089","inReplyTo":"20210710234629.17197-1-felipe.contreras@gmail.com","subject":"Re: [PATCH v2 0/2] extra: new concept of extra components","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2021-07-12T17:43:42Z","receivedAt":"2021-07-12T17:43:47Z","isPatch":true,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"Hi Felipe,\n\nLe 2021-07-10 à 19:46, Felipe Contreras a écrit :\n> This patch series introduces the concept of extra components. These are\n> components which are not yet part of the core but are good enough for\n> distributions to ship, and in fact, they already do.\n> \n> This benefits everyone:\n> \n>   1. Distribution packagers that just want to do `make install`\n>   2. People who download git's source code and just want to do\n>      `make install`\n>   3. Developers who have no idea what's production-level quality in\n>      contrib/ and just want to do `make install`.\n> \n> For now they'll have to do `make install install-extra`. But if the\n> result is deemed correct, we might choose to add \"install-extra\" to the\n> \"install\" target.\n\nI agree with the end goal of this series. I myself carry a patch that adds an\n'install-completion' target to the main Makefile that I apply before installing\nGit from 'master'.\n\n> \n> The measuring stick I'm using to gauge if a component in contrib belongs\n> in extra is simple: are we already running tests for them with\n> 'make test'? If the answer is \"yes, we do run tests\", then the answer is\n> \"yes, it belongs in contrib\".\n\nOK, this seems about right, it should cover prompt and completion, but...\n\n> \n> We might want to move more components from contrib to extra once their\n> tests are being run reliably.\n> \n> And we might move some components from the core which aren't really part\n> of the core to extra, like gitk, git-gui, git-p4, and git-svn.\n> \n> For now only contrib/completion and contrib/workdir are graduated to the\n> new area.\n\n... when I read this I went \"what is this workdir thing, it must date from before\n'git worktree' was added\". And combing through the history, it does. The latest\ncommit to the script is e32afab7b0 (git-new-workdir: don't fail if the target\ndirectory is empty, 2014-11-26), which describes as v2.3.0-rc0~60^2. And\n'git worktree' was shipped in Git 2.5, 2015-07-27.\n\nLooking at the tests, I see two uses of 'git-new-workdir':\n$ git grep  -p 'new-workdir'\nt1021-rerere-in-workdir.sh=28=test_expect_success SYMLINKS 'rerere in workdir' '\nt1021-rerere-in-workdir.sh:30:56:       \"$SHELL_PATH\" \"$TEST_DIRECTORY/../contrib/workdir/git-new-workdir\" . work &&\nt1021-rerere-in-workdir.sh:41:50:# For the purpose of helping contrib/workdir/git-new-workdir users, we do not\nt1021-rerere-in-workdir.sh=44=test_expect_failure SYMLINKS 'rerere in workdir (relative)' '\nt1021-rerere-in-workdir.sh:46:56:       \"$SHELL_PATH\" \"$TEST_DIRECTORY/../contrib/workdir/git-new-workdir\" . krow &&\nt3000-ls-files-others.sh=75=test_expect_success SYMLINKS 'ls-files --others with symlinked submodule' '\nt3000-ls-files-others.sh:87:57:         \"$SHELL_PATH\" \"$TEST_DIRECTORY/../contrib/workdir/git-new-workdir\" ../sub sub &&\n\nSo they are not really testing this script per se, more like testing rerere and ls-files\nin a worktree created by 'git-new-workdir'. I do not think this enough justification\nto include 'git new-workdir' in 'extra/', since 'git worktree add' does the same thing\nand is a builtin command. Even if its \"BUGS\" section in the doc says it's \"in general [...]\nstill experimental\", an experimental builtin is better than a 'contrib' script, no ?\n\nCheers,\n\nPhilippe.\n"},{"id":"429789","messageId":"60ec8202213a1_a231f20891@natae.notmuch","threadId":"56089","inReplyTo":"c530dedb-8cad-2a73-5b56-a32173046382@gmail.com","subject":"Re: [PATCH v2 0/2] extra: new concept of extra components","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-12T17:55:14Z","receivedAt":"2021-07-12T17:55:19Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Philippe Blain wrote:\n> Le 2021-07-10 à 19:46, Felipe Contreras a écrit :\n\n> > We might want to move more components from contrib to extra once their\n> > tests are being run reliably.\n> > \n> > And we might move some components from the core which aren't really part\n> > of the core to extra, like gitk, git-gui, git-p4, and git-svn.\n> > \n> > For now only contrib/completion and contrib/workdir are graduated to the\n> > new area.\n> \n> ... when I read this I went \"what is this workdir thing, it must date from before\n> 'git worktree' was added\". And combing through the history, it does. The latest\n> commit to the script is e32afab7b0 (git-new-workdir: don't fail if the target\n> directory is empty, 2014-11-26), which describes as v2.3.0-rc0~60^2. And\n> 'git worktree' was shipped in Git 2.5, 2015-07-27.\n> \n> Looking at the tests, I see two uses of 'git-new-workdir':\n> $ git grep  -p 'new-workdir'\n> t1021-rerere-in-workdir.sh=28=test_expect_success SYMLINKS 'rerere in workdir' '\n> t1021-rerere-in-workdir.sh:30:56:       \"$SHELL_PATH\" \"$TEST_DIRECTORY/../contrib/workdir/git-new-workdir\" . work &&\n> t1021-rerere-in-workdir.sh:41:50:# For the purpose of helping contrib/workdir/git-new-workdir users, we do not\n> t1021-rerere-in-workdir.sh=44=test_expect_failure SYMLINKS 'rerere in workdir (relative)' '\n> t1021-rerere-in-workdir.sh:46:56:       \"$SHELL_PATH\" \"$TEST_DIRECTORY/../contrib/workdir/git-new-workdir\" . krow &&\n> t3000-ls-files-others.sh=75=test_expect_success SYMLINKS 'ls-files --others with symlinked submodule' '\n> t3000-ls-files-others.sh:87:57:         \"$SHELL_PATH\" \"$TEST_DIRECTORY/../contrib/workdir/git-new-workdir\" ../sub sub &&\n> \n> So they are not really testing this script per se, more like testing rerere and ls-files\n> in a worktree created by 'git-new-workdir'. I do not think this enough justification\n> to include 'git new-workdir' in 'extra/', since 'git worktree add' does the same thing\n> and is a builtin command. Even if its \"BUGS\" section in the doc says it's \"in general [...]\n> still experimental\", an experimental builtin is better than a 'contrib' script, no ?\n\nI agree.\n\nHowever, that points out to another problem: the tests should not be using `git new-workdir`.\n\nI'm fine with dropping the last patch from the series.\n\n-- \nFelipe Contreras"},{"id":"429858","messageId":"xmqq5yxf2hkj.fsf@gitster.g","threadId":"56089","inReplyTo":"c530dedb-8cad-2a73-5b56-a32173046382@gmail.com","subject":"Re: [PATCH v2 0/2] extra: new concept of extra components","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-07-13T00:17:16Z","receivedAt":"2021-07-13T00:17:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Philippe Blain <levraiphilippeblain@gmail.com> writes:\n\n> in a worktree created by 'git-new-workdir'. I do not think this enough justification\n> to include 'git new-workdir' in 'extra/', since 'git worktree add' does the same thing\n> and is a builtin command.\n\n\"git worktree\" was invented primarily to properly solve what\nnew-workdir wanted to, so I agree that all efforts to promote,\nupkeep and extend the latter should be spent to improve the former.\n\n\n"},{"id":"429860","messageId":"60ecea068fd7a_a79ec208e9@natae.notmuch","threadId":"56089","inReplyTo":"xmqq5yxf2hkj.fsf@gitster.g","subject":"Re: [PATCH v2 0/2] extra: new concept of extra components","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-13T01:19:02Z","receivedAt":"2021-07-13T01:19:08Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Junio C Hamano wrote:\n> Philippe Blain <levraiphilippeblain@gmail.com> writes:\n> \n> > in a worktree created by 'git-new-workdir'. I do not think this enough justification\n> > to include 'git new-workdir' in 'extra/', since 'git worktree add' does the same thing\n> > and is a builtin command.\n> \n> \"git worktree\" was invented primarily to properly solve what\n> new-workdir wanted to, so I agree that all efforts to promote,\n> upkeep and extend the latter should be spent to improve the former.\n\nOK. What about $subject?\n\n-- \nFelipe Contreras\n"},{"id":"430121","messageId":"20210714202344.614468-1-felipe.contreras@gmail.com","threadId":"56089","inReplyTo":"20210710234629.17197-1-felipe.contreras@gmail.com","subject":"[PATCH v3 0/1] extra: new concept of extra components","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-14T20:23:43Z","receivedAt":"2021-07-14T20:23:48Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"This patch series introduces the concept of extra components. These are\ncomponents which are not yet part of the core but are good enough for\ndistributions to ship, and in fact, they already do.\n\nThis benefits everyone:\n\n 1. Distribution packagers that just want to do `make install`\n 2. People who download git's source code and just want to do\n    `make install`\n 3. Developers who have no idea what's production-level quality in\n    contrib/ and just want to do `make install`.\n\nFor now they'll have to do `make install install-extra`. But if the\nresult is deemed correct, we might choose to add \"install-extra\" to the\n\"install\" target.\n\nThe measuring stick I'm using to gauge if a component in contrib belongs\nin extra is simple: are we already running tests for them with\n'make test'? If the answer is \"yes, we do run tests\", then the answer is\n\"yes, it belongs in contrib\".\n\nWe might want to move more components from contrib to extra once their\ntests are being run reliably.\n\nAnd we might move some components from the core which aren't really part\nof the core to extra, like gitk, git-gui, git-p4, and git-svn.\n\nFor now only part of contrib/completion is graduated to the new area.\n\nSince v2 I removed workdir from the list of graduates as Philippe Blain\nsuggested.\n\nFelipe Contreras (1):\n  completion: graduate out of contrib\n\n Makefile                                          | 10 ++++++++++\n {contrib => extra}/completion/git-completion.bash |  0\n {contrib => extra}/completion/git-completion.zsh  |  0\n {contrib => extra}/completion/git-prompt.sh       |  0\n t/t9902-completion.sh                             |  8 ++++----\n t/t9903-bash-prompt.sh                            |  2 +-\n 6 files changed, 15 insertions(+), 5 deletions(-)\n rename {contrib => extra}/completion/git-completion.bash (100%)\n rename {contrib => extra}/completion/git-completion.zsh (100%)\n rename {contrib => extra}/completion/git-prompt.sh (100%)\n\nRange-diff against v2:\n1:  3f44bc3253 = 1:  3f44bc3253 completion: graduate out of contrib\n2:  af9b24eeb1 < -:  ---------- git-new-workdir: graduate out of contrib\n-- \n2.32.0.38.g1d70fa854e\n\n"},{"id":"430122","messageId":"20210714202344.614468-2-felipe.contreras@gmail.com","threadId":"56089","inReplyTo":"20210714202344.614468-1-felipe.contreras@gmail.com","subject":"[PATCH v3 1/1] completion: graduate out of contrib","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-14T20:23:44Z","receivedAt":"2021-07-14T20:23:50Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"These have been stable and widely used for quite a long time, they even\nhave tests outside of the contrib area, and most distributions ship\nthem, so they can be considered part of the core already.\n\nWe should be consistent and either we move the tests to contrib, or we\nmove the completions out of contrib.\n\nLet's move them out of contrib and provide an installation target\ninstall-extra.\n\nBy default bash-completion installs the completions to\n$(pkgdatadir)/completions, which is\n$(prefix)/share/bash-completion/completions. And since most distributions do\nnot change this, it is obviously the right default that distributions\ncan override with bashcompdir.\n\nBy default zsh looks for completions in\n$(prefix)/share/zsh/site-functions.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile                                          | 10 ++++++++++\n {contrib => extra}/completion/git-completion.bash |  0\n {contrib => extra}/completion/git-completion.zsh  |  0\n {contrib => extra}/completion/git-prompt.sh       |  0\n t/t9902-completion.sh                             |  8 ++++----\n t/t9903-bash-prompt.sh                            |  2 +-\n 6 files changed, 15 insertions(+), 5 deletions(-)\n rename {contrib => extra}/completion/git-completion.bash (100%)\n rename {contrib => extra}/completion/git-completion.zsh (100%)\n rename {contrib => extra}/completion/git-prompt.sh (100%)\n\ndiff --git a/Makefile b/Makefile\nindex 502e0c9a81..0a13e5f077 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -532,6 +532,7 @@ sharedir = $(prefix)/share\n gitwebdir = $(sharedir)/gitweb\n perllibdir = $(sharedir)/perl5\n localedir = $(sharedir)/locale\n+bashcompdir = $(sharedir)/bash-completion/completions\n template_dir = share/git-core/templates\n htmldir = $(prefix)/share/doc/git-doc\n ETC_GITCONFIG = $(sysconfdir)/gitconfig\n@@ -2015,6 +2016,7 @@ bindir_relative_SQ = $(subst ','\\'',$(bindir_relative))\n mandir_SQ = $(subst ','\\'',$(mandir))\n mandir_relative_SQ = $(subst ','\\'',$(mandir_relative))\n infodir_relative_SQ = $(subst ','\\'',$(infodir_relative))\n+sharedir_SQ = $(subst ','\\'',$(sharedir))\n perllibdir_SQ = $(subst ','\\'',$(perllibdir))\n localedir_SQ = $(subst ','\\'',$(localedir))\n localedir_relative_SQ = $(subst ','\\'',$(localedir_relative))\n@@ -2025,6 +2027,7 @@ htmldir_relative_SQ = $(subst ','\\'',$(htmldir_relative))\n prefix_SQ = $(subst ','\\'',$(prefix))\n perllibdir_relative_SQ = $(subst ','\\'',$(perllibdir_relative))\n gitwebdir_SQ = $(subst ','\\'',$(gitwebdir))\n+bashcompdir_SQ = $(subst ','\\'',$(bashcompdir))\n \n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n TEST_SHELL_PATH_SQ = $(subst ','\\'',$(TEST_SHELL_PATH))\n@@ -3112,6 +3115,13 @@ quick-install-man:\n quick-install-html:\n \t$(MAKE) -C Documentation quick-install-html\n \n+install-extra: install-completion\n+\n+install-completion:\n+\t$(INSTALL) -D -m 644 extra/completion/git-completion.bash '$(DESTDIR_SQ)$(bashcompdir_SQ)'/git\n+\t$(INSTALL) -D -m 644 extra/completion/git-prompt.sh '$(DESTDIR_SQ)$(sharedir_SQ)'/git-core/git-prompt.sh\n+\t$(INSTALL) -D -m 644 extra/completion/git-completion.zsh '$(DESTDIR_SQ)$(sharedir_SQ)'/zsh/site-functions/_git\n+\n \n \n ### Maintainer's dist rules\ndiff --git a/contrib/completion/git-completion.bash b/extra/completion/git-completion.bash\nsimilarity index 100%\nrename from contrib/completion/git-completion.bash\nrename to extra/completion/git-completion.bash\ndiff --git a/contrib/completion/git-completion.zsh b/extra/completion/git-completion.zsh\nsimilarity index 100%\nrename from contrib/completion/git-completion.zsh\nrename to extra/completion/git-completion.zsh\ndiff --git a/contrib/completion/git-prompt.sh b/extra/completion/git-prompt.sh\nsimilarity index 100%\nrename from contrib/completion/git-prompt.sh\nrename to extra/completion/git-prompt.sh\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex cb057ef161..32601b755d 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -36,7 +36,7 @@ complete ()\n GIT_TESTING_ALL_COMMAND_LIST='add checkout check-attr rebase ls-files'\n GIT_TESTING_PORCELAIN_COMMAND_LIST='add checkout rebase'\n \n-. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\"\n+. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\"\n \n # We don't need this function to actually join words or do anything special.\n # Also, it's cleaner to avoid touching bash's internal completion variables.\n@@ -2383,14 +2383,14 @@ test_expect_success 'git clone --config= - value' '\n test_expect_success 'sourcing the completion script clears cached commands' '\n \t__git_compute_all_commands &&\n \tverbose test -n \"$__git_all_commands\" &&\n-\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n+\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n \tverbose test -z \"$__git_all_commands\"\n '\n \n test_expect_success 'sourcing the completion script clears cached merge strategies' '\n \t__git_compute_merge_strategies &&\n \tverbose test -n \"$__git_merge_strategies\" &&\n-\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n+\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n \tverbose test -z \"$__git_merge_strategies\"\n '\n \n@@ -2399,7 +2399,7 @@ test_expect_success 'sourcing the completion script clears cached --options' '\n \tverbose test -n \"$__gitcomp_builtin_checkout\" &&\n \t__gitcomp_builtin notes_edit &&\n \tverbose test -n \"$__gitcomp_builtin_notes_edit\" &&\n-\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n+\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n \tverbose test -z \"$__gitcomp_builtin_checkout\" &&\n \tverbose test -z \"$__gitcomp_builtin_notes_edit\"\n '\ndiff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\nindex bbd513bab0..784e523fd4 100755\n--- a/t/t9903-bash-prompt.sh\n+++ b/t/t9903-bash-prompt.sh\n@@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./lib-bash.sh\n \n-. \"$GIT_BUILD_DIR/contrib/completion/git-prompt.sh\"\n+. \"$GIT_BUILD_DIR/extra/completion/git-prompt.sh\"\n \n actual=\"$TRASH_DIRECTORY/actual\"\n c_red='\\\\[\\\\e[31m\\\\]'\n-- \n2.32.0.38.g1d70fa854e\n\n"},{"id":"430158","messageId":"87bl74zdtb.fsf@evledraar.gmail.com","threadId":"56089","inReplyTo":"20210714202344.614468-2-felipe.contreras@gmail.com","subject":"Re: [PATCH v3 1/1] completion: graduate out of contrib","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-07-14T23:03:51Z","receivedAt":"2021-07-14T23:16:31Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Jul 14 2021, Felipe Contreras wrote:\n\n> These have been stable and widely used for quite a long time, they even\n> have tests outside of the contrib area, and most distributions ship\n> them, so they can be considered part of the core already.\n>\n> We should be consistent and either we move the tests to contrib, or we\n> move the completions out of contrib.\n>\n> Let's move them out of contrib and provide an installation target\n> install-extra.\n>\n> By default bash-completion installs the completions to\n> $(pkgdatadir)/completions, which is\n> $(prefix)/share/bash-completion/completions. And since most distributions do\n> not change this, it is obviously the right default that distributions\n> can override with bashcompdir.\n>\n> By default zsh looks for completions in\n> $(prefix)/share/zsh/site-functions.\n\nI'm very much in favor of this, i.e. both to promote git-completion.*,\nand also to generally re-organize contrib/* a bit (not being done here).\n\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  Makefile                                          | 10 ++++++++++\n>  {contrib => extra}/completion/git-completion.bash |  0\n>  {contrib => extra}/completion/git-completion.zsh  |  0\n>  {contrib => extra}/completion/git-prompt.sh       |  0\n>  t/t9902-completion.sh                             |  8 ++++----\n>  t/t9903-bash-prompt.sh                            |  2 +-\n>  6 files changed, 15 insertions(+), 5 deletions(-)\n>  rename {contrib => extra}/completion/git-completion.bash (100%)\n>  rename {contrib => extra}/completion/git-completion.zsh (100%)\n>  rename {contrib => extra}/completion/git-prompt.sh (100%)\n>\n> diff --git a/Makefile b/Makefile\n> index 502e0c9a81..0a13e5f077 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -532,6 +532,7 @@ sharedir = $(prefix)/share\n>  gitwebdir = $(sharedir)/gitweb\n>  perllibdir = $(sharedir)/perl5\n>  localedir = $(sharedir)/locale\n> +bashcompdir = $(sharedir)/bash-completion/completions\n>  template_dir = share/git-core/templates\n>  htmldir = $(prefix)/share/doc/git-doc\n>  ETC_GITCONFIG = $(sysconfdir)/gitconfig\n> @@ -2015,6 +2016,7 @@ bindir_relative_SQ = $(subst ','\\'',$(bindir_relative))\n>  mandir_SQ = $(subst ','\\'',$(mandir))\n>  mandir_relative_SQ = $(subst ','\\'',$(mandir_relative))\n>  infodir_relative_SQ = $(subst ','\\'',$(infodir_relative))\n> +sharedir_SQ = $(subst ','\\'',$(sharedir))\n>  perllibdir_SQ = $(subst ','\\'',$(perllibdir))\n>  localedir_SQ = $(subst ','\\'',$(localedir))\n>  localedir_relative_SQ = $(subst ','\\'',$(localedir_relative))\n> @@ -2025,6 +2027,7 @@ htmldir_relative_SQ = $(subst ','\\'',$(htmldir_relative))\n>  prefix_SQ = $(subst ','\\'',$(prefix))\n>  perllibdir_relative_SQ = $(subst ','\\'',$(perllibdir_relative))\n>  gitwebdir_SQ = $(subst ','\\'',$(gitwebdir))\n> +bashcompdir_SQ = $(subst ','\\'',$(bashcompdir))\n>  \n>  SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n>  TEST_SHELL_PATH_SQ = $(subst ','\\'',$(TEST_SHELL_PATH))\n> @@ -3112,6 +3115,13 @@ quick-install-man:\n>  quick-install-html:\n>  \t$(MAKE) -C Documentation quick-install-html\n>  \n> +install-extra: install-completion\n> +\n> +install-completion:\n> +\t$(INSTALL) -D -m 644 extra/completion/git-completion.bash '$(DESTDIR_SQ)$(bashcompdir_SQ)'/git\n> +\t$(INSTALL) -D -m 644 extra/completion/git-prompt.sh '$(DESTDIR_SQ)$(sharedir_SQ)'/git-core/git-prompt.sh\n> +\t$(INSTALL) -D -m 644 extra/completion/git-completion.zsh '$(DESTDIR_SQ)$(sharedir_SQ)'/zsh/site-functions/_git\n> +\nThese are missing a .PHONY target (like the other install-* targets).\n\nThe bash-completion target corresponds to what I've got in Debian's git\npackage, but not the prompt:\n    \n    $ dpkg -L git|grep -e completion -e prompt\n    /etc/bash_completion.d\n    /etc/bash_completion.d/git-prompt\n    /usr/lib/git-core/git-sh-prompt\n    /usr/share/bash-completion\n    /usr/share/bash-completion/completions\n    /usr/share/bash-completion/completions/git\n    /usr/share/bash-completion/completions/gitk\n\nI've got no idea what we should pick by default though, maybe what you\nhave is more standard.\n\nAlso why /git and /_git for bash and zsh (looks good) but /git-prompt\ninstead of /git-prompt.sh?\n\n>  \n>  ### Maintainer's dist rules\n> diff --git a/contrib/completion/git-completion.bash b/extra/completion/git-completion.bash\n> similarity index 100%\n> rename from contrib/completion/git-completion.bash\n> rename to extra/completion/git-completion.bash\n> diff --git a/contrib/completion/git-completion.zsh b/extra/completion/git-completion.zsh\n> similarity index 100%\n> rename from contrib/completion/git-completion.zsh\n> rename to extra/completion/git-completion.zsh\n> diff --git a/contrib/completion/git-prompt.sh b/extra/completion/git-prompt.sh\n> similarity index 100%\n> rename from contrib/completion/git-prompt.sh\n> rename to extra/completion/git-prompt.sh\n> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\n> index cb057ef161..32601b755d 100755\n> --- a/t/t9902-completion.sh\n> +++ b/t/t9902-completion.sh\n> @@ -36,7 +36,7 @@ complete ()\n>  GIT_TESTING_ALL_COMMAND_LIST='add checkout check-attr rebase ls-files'\n>  GIT_TESTING_PORCELAIN_COMMAND_LIST='add checkout rebase'\n>  \n> -. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\"\n> +. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\"\n>  \n>  # We don't need this function to actually join words or do anything special.\n>  # Also, it's cleaner to avoid touching bash's internal completion variables.\n> @@ -2383,14 +2383,14 @@ test_expect_success 'git clone --config= - value' '\n>  test_expect_success 'sourcing the completion script clears cached commands' '\n>  \t__git_compute_all_commands &&\n>  \tverbose test -n \"$__git_all_commands\" &&\n> -\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n> +\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n>  \tverbose test -z \"$__git_all_commands\"\n>  '\n>  \n>  test_expect_success 'sourcing the completion script clears cached merge strategies' '\n>  \t__git_compute_merge_strategies &&\n>  \tverbose test -n \"$__git_merge_strategies\" &&\n> -\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n> +\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n>  \tverbose test -z \"$__git_merge_strategies\"\n>  '\n>  \n> @@ -2399,7 +2399,7 @@ test_expect_success 'sourcing the completion script clears cached --options' '\n>  \tverbose test -n \"$__gitcomp_builtin_checkout\" &&\n>  \t__gitcomp_builtin notes_edit &&\n>  \tverbose test -n \"$__gitcomp_builtin_notes_edit\" &&\n> -\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n> +\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n>  \tverbose test -z \"$__gitcomp_builtin_checkout\" &&\n>  \tverbose test -z \"$__gitcomp_builtin_notes_edit\"\n>  '\n>\n> diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\n> index bbd513bab0..784e523fd4 100755\n> --- a/t/t9903-bash-prompt.sh\n> +++ b/t/t9903-bash-prompt.sh\n> @@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>  \n>  . ./lib-bash.sh\n>  \n> -. \"$GIT_BUILD_DIR/contrib/completion/git-prompt.sh\"\n> +. \"$GIT_BUILD_DIR/extra/completion/git-prompt.sh\"\n>  \n>  actual=\"$TRASH_DIRECTORY/actual\"\n>  c_red='\\\\[\\\\e[31m\\\\]'\n\nIt's more of a \"for bonus points\", but a nic way to round-trip this\nwould be to make this work with GIT_TEST_INSTALLED.\n\nI.e. source these relative to GIT_EXEC_PATH, not $GIT_BUILD_DIR, I think\nthat just sourcing them as e.g.:\n\n    . git-completion.bash\n\nBut the GIT_TEST_INSTALLED case is tricker, maybe we'd need to add a\n\"git --share-path\" :(\n"},{"id":"430159","messageId":"878s28zdmz.fsf@evledraar.gmail.com","threadId":"56089","inReplyTo":"87bl74zdtb.fsf@evledraar.gmail.com","subject":"Re: [PATCH v3 1/1] completion: graduate out of contrib","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-07-14T23:17:04Z","receivedAt":"2021-07-14T23:20:18Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Jul 15 2021, Ævar Arnfjörð Bjarmason wrote:\n\n> On Wed, Jul 14 2021, Felipe Contreras wrote:\n>> [...]\n>> @@ -2399,7 +2399,7 @@ test_expect_success 'sourcing the completion script clears cached --options' '\n>>  \tverbose test -n \"$__gitcomp_builtin_checkout\" &&\n>>  \t__gitcomp_builtin notes_edit &&\n>>  \tverbose test -n \"$__gitcomp_builtin_notes_edit\" &&\n>> -\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n>> +\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n>>  \tverbose test -z \"$__gitcomp_builtin_checkout\" &&\n>>  \tverbose test -z \"$__gitcomp_builtin_notes_edit\"\n>>  '\n>>\n>> diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\n>> index bbd513bab0..784e523fd4 100755\n>> --- a/t/t9903-bash-prompt.sh\n>> +++ b/t/t9903-bash-prompt.sh\n>> @@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>>  \n>>  . ./lib-bash.sh\n>>  \n>> -. \"$GIT_BUILD_DIR/contrib/completion/git-prompt.sh\"\n>> +. \"$GIT_BUILD_DIR/extra/completion/git-prompt.sh\"\n>>  \n>>  actual=\"$TRASH_DIRECTORY/actual\"\n>>  c_red='\\\\[\\\\e[31m\\\\]'\n>\n> It's more of a \"for bonus points\", but a nic way to round-trip this\n> would be to make this work with GIT_TEST_INSTALLED.\n>\n> I.e. source these relative to GIT_EXEC_PATH, not $GIT_BUILD_DIR, I think\n> that just sourcing them as e.g.:\n>\n>     . git-completion.bash\n>\n> But the GIT_TEST_INSTALLED case is tricker, maybe we'd need to add a\n> \"git --share-path\" :(\n\nI forgot to include this not-working patch, i.e. I've got no idea what\nthe \"something\" should be other than the harder thing of compiling\n\"sharedir\" into git and making \"git --share-path\" work.\n\nIt's not /that/ bad, see the grep for GIT_LOCALE_PATH, still a bit\npainful, and maybe not worth it for this change...\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 98e20950c3..0a9fbfc253 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1301,7 +1301,7 @@ elif test -n \"$GIT_TEST_INSTALLED\"\n then\n \tGIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path)  ||\n \terror \"Cannot run git from $GIT_TEST_INSTALLED.\"\n-\tPATH=$GIT_TEST_INSTALLED:$GIT_BUILD_DIR/t/helper:$PATH\n+\tPATH=$GIT_TEST_INSTALLED:$GIT_TEST_INSTALLED/something:$GIT_BUILD_DIR/t/helper:$PATH\n \tGIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}\n else # normal case, use ../bin-wrappers only unless $with_dashes:\n \tif test -n \"$no_bin_wrappers\"\n@@ -1322,7 +1322,7 @@ else # normal case, use ../bin-wrappers only unless $with_dashes:\n \tGIT_EXEC_PATH=$GIT_BUILD_DIR\n \tif test -n \"$with_dashes\"\n \tthen\n-\t\tPATH=\"$GIT_BUILD_DIR:$GIT_BUILD_DIR/t/helper:$PATH\"\n+\t\tPATH=\"$GIT_BUILD_DIR:$GIT_BUILD_DIR/t/helper:$GIT_BUILD_DIR/extra/completion:$PATH\"\n \tfi\n fi\n GIT_TEMPLATE_DIR=\"$GIT_BUILD_DIR\"/templates/blt\n"},{"id":"430261","messageId":"60f0859399369_519c2083c@natae.notmuch","threadId":"56089","inReplyTo":"87bl74zdtb.fsf@evledraar.gmail.com","subject":"Re: [PATCH v3 1/1] completion: graduate out of contrib","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-15T18:59:31Z","receivedAt":"2021-07-15T19:08:50Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> On Wed, Jul 14 2021, Felipe Contreras wrote:\n\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -532,6 +532,7 @@ sharedir = $(prefix)/share\n> >  gitwebdir = $(sharedir)/gitweb\n> >  perllibdir = $(sharedir)/perl5\n> >  localedir = $(sharedir)/locale\n> > +bashcompdir = $(sharedir)/bash-completion/completions\n> >  template_dir = share/git-core/templates\n> >  htmldir = $(prefix)/share/doc/git-doc\n> >  ETC_GITCONFIG = $(sysconfdir)/gitconfig\n> > @@ -2015,6 +2016,7 @@ bindir_relative_SQ = $(subst ','\\'',$(bindir_relative))\n> >  mandir_SQ = $(subst ','\\'',$(mandir))\n> >  mandir_relative_SQ = $(subst ','\\'',$(mandir_relative))\n> >  infodir_relative_SQ = $(subst ','\\'',$(infodir_relative))\n> > +sharedir_SQ = $(subst ','\\'',$(sharedir))\n> >  perllibdir_SQ = $(subst ','\\'',$(perllibdir))\n> >  localedir_SQ = $(subst ','\\'',$(localedir))\n> >  localedir_relative_SQ = $(subst ','\\'',$(localedir_relative))\n> > @@ -2025,6 +2027,7 @@ htmldir_relative_SQ = $(subst ','\\'',$(htmldir_relative))\n> >  prefix_SQ = $(subst ','\\'',$(prefix))\n> >  perllibdir_relative_SQ = $(subst ','\\'',$(perllibdir_relative))\n> >  gitwebdir_SQ = $(subst ','\\'',$(gitwebdir))\n> > +bashcompdir_SQ = $(subst ','\\'',$(bashcompdir))\n> >  \n> >  SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n> >  TEST_SHELL_PATH_SQ = $(subst ','\\'',$(TEST_SHELL_PATH))\n> > @@ -3112,6 +3115,13 @@ quick-install-man:\n> >  quick-install-html:\n> >  \t$(MAKE) -C Documentation quick-install-html\n> >  \n> > +install-extra: install-completion\n> > +\n> > +install-completion:\n> > +\t$(INSTALL) -D -m 644 extra/completion/git-completion.bash '$(DESTDIR_SQ)$(bashcompdir_SQ)'/git\n> > +\t$(INSTALL) -D -m 644 extra/completion/git-prompt.sh '$(DESTDIR_SQ)$(sharedir_SQ)'/git-core/git-prompt.sh\n> > +\t$(INSTALL) -D -m 644 extra/completion/git-completion.zsh '$(DESTDIR_SQ)$(sharedir_SQ)'/zsh/site-functions/_git\n> > +\n> These are missing a .PHONY target (like the other install-* targets).\n\nAll right.\n\n> The bash-completion target corresponds to what I've got in Debian's git\n> package, but not the prompt:\n>     \n>     $ dpkg -L git|grep -e completion -e prompt\n>     /etc/bash_completion.d\n>     /etc/bash_completion.d/git-prompt\n>     /usr/lib/git-core/git-sh-prompt\n>     /usr/share/bash-completion\n>     /usr/share/bash-completion/completions\n>     /usr/share/bash-completion/completions/git\n>     /usr/share/bash-completion/completions/gitk\n> \n> I've got no idea what we should pick by default though, maybe what you\n> have is more standard.\n\ngit-prompt.sh is not really part of the completion stuff, so I don't\nthink the location Debian chose is correct. At some point in time they\nwere together, so perhaps that why they chose the same location.\n\nGenerally scripts and other shared data belongs in /usr/share.\n\n> Also why /git and /_git for bash and zsh (looks good) but /git-prompt\n> instead of /git-prompt.sh?\n\nProbably because it was split from 'git'.\n\n> >  ### Maintainer's dist rules\n> > diff --git a/contrib/completion/git-completion.bash b/extra/completion/git-completion.bash\n> > similarity index 100%\n> > rename from contrib/completion/git-completion.bash\n> > rename to extra/completion/git-completion.bash\n> > diff --git a/contrib/completion/git-completion.zsh b/extra/completion/git-completion.zsh\n> > similarity index 100%\n> > rename from contrib/completion/git-completion.zsh\n> > rename to extra/completion/git-completion.zsh\n> > diff --git a/contrib/completion/git-prompt.sh b/extra/completion/git-prompt.sh\n> > similarity index 100%\n> > rename from contrib/completion/git-prompt.sh\n> > rename to extra/completion/git-prompt.sh\n> > diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\n> > index cb057ef161..32601b755d 100755\n> > --- a/t/t9902-completion.sh\n> > +++ b/t/t9902-completion.sh\n> > @@ -36,7 +36,7 @@ complete ()\n> >  GIT_TESTING_ALL_COMMAND_LIST='add checkout check-attr rebase ls-files'\n> >  GIT_TESTING_PORCELAIN_COMMAND_LIST='add checkout rebase'\n> >  \n> > -. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\"\n> > +. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\"\n> >  \n> >  # We don't need this function to actually join words or do anything special.\n> >  # Also, it's cleaner to avoid touching bash's internal completion variables.\n> > @@ -2383,14 +2383,14 @@ test_expect_success 'git clone --config= - value' '\n> >  test_expect_success 'sourcing the completion script clears cached commands' '\n> >  \t__git_compute_all_commands &&\n> >  \tverbose test -n \"$__git_all_commands\" &&\n> > -\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n> > +\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n> >  \tverbose test -z \"$__git_all_commands\"\n> >  '\n> >  \n> >  test_expect_success 'sourcing the completion script clears cached merge strategies' '\n> >  \t__git_compute_merge_strategies &&\n> >  \tverbose test -n \"$__git_merge_strategies\" &&\n> > -\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n> > +\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n> >  \tverbose test -z \"$__git_merge_strategies\"\n> >  '\n> >  \n> > @@ -2399,7 +2399,7 @@ test_expect_success 'sourcing the completion script clears cached --options' '\n> >  \tverbose test -n \"$__gitcomp_builtin_checkout\" &&\n> >  \t__gitcomp_builtin notes_edit &&\n> >  \tverbose test -n \"$__gitcomp_builtin_notes_edit\" &&\n> > -\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n> > +\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n> >  \tverbose test -z \"$__gitcomp_builtin_checkout\" &&\n> >  \tverbose test -z \"$__gitcomp_builtin_notes_edit\"\n> >  '\n> >\n> > diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\n> > index bbd513bab0..784e523fd4 100755\n> > --- a/t/t9903-bash-prompt.sh\n> > +++ b/t/t9903-bash-prompt.sh\n> > @@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n> >  \n> >  . ./lib-bash.sh\n> >  \n> > -. \"$GIT_BUILD_DIR/contrib/completion/git-prompt.sh\"\n> > +. \"$GIT_BUILD_DIR/extra/completion/git-prompt.sh\"\n> >  \n> >  actual=\"$TRASH_DIRECTORY/actual\"\n> >  c_red='\\\\[\\\\e[31m\\\\]'\n> \n> It's more of a \"for bonus points\", but a nic way to round-trip this\n> would be to make this work with GIT_TEST_INSTALLED.\n> \n> I.e. source these relative to GIT_EXEC_PATH, not $GIT_BUILD_DIR, I think\n> that just sourcing them as e.g.:\n> \n>     . git-completion.bash\n> \n> But the GIT_TEST_INSTALLED case is tricker, maybe we'd need to add a\n> \"git --share-path\" :(\n\nYes, we would need --share-path, and perhaps GIT_SHARE_PATH, and so on.\n\nMight make sense for a future patch.\n\n-- \nFelipe Contreras"},{"id":"430263","messageId":"60f088b054e74_519c2084d@natae.notmuch","threadId":"56089","inReplyTo":"878s28zdmz.fsf@evledraar.gmail.com","subject":"Re: [PATCH v3 1/1] completion: graduate out of contrib","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-15T19:12:48Z","receivedAt":"2021-07-15T19:34:22Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> \n> On Thu, Jul 15 2021, Ævar Arnfjörð Bjarmason wrote:\n> \n> > On Wed, Jul 14 2021, Felipe Contreras wrote:\n> >> [...]\n> >> @@ -2399,7 +2399,7 @@ test_expect_success 'sourcing the completion script clears cached --options' '\n> >>  \tverbose test -n \"$__gitcomp_builtin_checkout\" &&\n> >>  \t__gitcomp_builtin notes_edit &&\n> >>  \tverbose test -n \"$__gitcomp_builtin_notes_edit\" &&\n> >> -\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n> >> +\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n> >>  \tverbose test -z \"$__gitcomp_builtin_checkout\" &&\n> >>  \tverbose test -z \"$__gitcomp_builtin_notes_edit\"\n> >>  '\n> >>\n> >> diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\n> >> index bbd513bab0..784e523fd4 100755\n> >> --- a/t/t9903-bash-prompt.sh\n> >> +++ b/t/t9903-bash-prompt.sh\n> >> @@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n> >>  \n> >>  . ./lib-bash.sh\n> >>  \n> >> -. \"$GIT_BUILD_DIR/contrib/completion/git-prompt.sh\"\n> >> +. \"$GIT_BUILD_DIR/extra/completion/git-prompt.sh\"\n> >>  \n> >>  actual=\"$TRASH_DIRECTORY/actual\"\n> >>  c_red='\\\\[\\\\e[31m\\\\]'\n> >\n> > It's more of a \"for bonus points\", but a nic way to round-trip this\n> > would be to make this work with GIT_TEST_INSTALLED.\n> >\n> > I.e. source these relative to GIT_EXEC_PATH, not $GIT_BUILD_DIR, I think\n> > that just sourcing them as e.g.:\n> >\n> >     . git-completion.bash\n> >\n> > But the GIT_TEST_INSTALLED case is tricker, maybe we'd need to add a\n> > \"git --share-path\" :(\n> \n> I forgot to include this not-working patch, i.e. I've got no idea what\n> the \"something\" should be other than the harder thing of compiling\n> \"sharedir\" into git and making \"git --share-path\" work.\n\nI don't think there's a \"something\" that would make sense.\n\nIt would be something like '/opt/git/bin/completion'?\n\n-- \nFelipe Contreras"},{"id":"430302","messageId":"87zgumyd7w.fsf@evledraar.gmail.com","threadId":"56089","inReplyTo":"60f088b054e74_519c2084d@natae.notmuch","subject":"Re: [PATCH v3 1/1] completion: graduate out of contrib","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-07-16T06:36:52Z","receivedAt":"2021-07-16T06:39:13Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Jul 15 2021, Felipe Contreras wrote:\n\n> Ævar Arnfjörð Bjarmason wrote:\n>> \n>> On Thu, Jul 15 2021, Ævar Arnfjörð Bjarmason wrote:\n>> \n>> > On Wed, Jul 14 2021, Felipe Contreras wrote:\n>> >> [...]\n>> >> @@ -2399,7 +2399,7 @@ test_expect_success 'sourcing the completion script clears cached --options' '\n>> >>  \tverbose test -n \"$__gitcomp_builtin_checkout\" &&\n>> >>  \t__gitcomp_builtin notes_edit &&\n>> >>  \tverbose test -n \"$__gitcomp_builtin_notes_edit\" &&\n>> >> -\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n>> >> +\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n>> >>  \tverbose test -z \"$__gitcomp_builtin_checkout\" &&\n>> >>  \tverbose test -z \"$__gitcomp_builtin_notes_edit\"\n>> >>  '\n>> >>\n>> >> diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\n>> >> index bbd513bab0..784e523fd4 100755\n>> >> --- a/t/t9903-bash-prompt.sh\n>> >> +++ b/t/t9903-bash-prompt.sh\n>> >> @@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>> >>  \n>> >>  . ./lib-bash.sh\n>> >>  \n>> >> -. \"$GIT_BUILD_DIR/contrib/completion/git-prompt.sh\"\n>> >> +. \"$GIT_BUILD_DIR/extra/completion/git-prompt.sh\"\n>> >>  \n>> >>  actual=\"$TRASH_DIRECTORY/actual\"\n>> >>  c_red='\\\\[\\\\e[31m\\\\]'\n>> >\n>> > It's more of a \"for bonus points\", but a nic way to round-trip this\n>> > would be to make this work with GIT_TEST_INSTALLED.\n>> >\n>> > I.e. source these relative to GIT_EXEC_PATH, not $GIT_BUILD_DIR, I think\n>> > that just sourcing them as e.g.:\n>> >\n>> >     . git-completion.bash\n>> >\n>> > But the GIT_TEST_INSTALLED case is tricker, maybe we'd need to add a\n>> > \"git --share-path\" :(\n>> \n>> I forgot to include this not-working patch, i.e. I've got no idea what\n>> the \"something\" should be other than the harder thing of compiling\n>> \"sharedir\" into git and making \"git --share-path\" work.\n>\n> I don't think there's a \"something\" that would make sense.\n>\n> It would be something like '/opt/git/bin/completion'?\n\nI think more importantly if they're going to be \"first-class\" components\nthat we have some native way of getting them to the user.\n\nI.e. once you install git being able to load them in your shell as:\n\n    . git-path\n    . git-completion\n\nOr whatever, which means either putting them in $PATH (i.e. we'd drop\nthem in bin/ along with the non-dashed-built-ins like git-upload-pack\netc.), or something like:\n\n    . \"$(git --completion-path)\"/bash\n    . \"$(git --completion-path)\"/zsh\n\nOr maybe:\n\n    . \"$(git --extras-path)\"/completion/bash.sh\n    . \"$(git --extras-path)\"/prompt.sh\n\n?\n"},{"id":"430386","messageId":"60f1e88949659_3302085e@natae.notmuch","threadId":"56089","inReplyTo":"87zgumyd7w.fsf@evledraar.gmail.com","subject":"Re: [PATCH v3 1/1] completion: graduate out of contrib","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-16T20:14:01Z","receivedAt":"2021-07-16T20:14:17Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Ævar Arnfjörð Bjarmason wrote:\n> On Thu, Jul 15 2021, Felipe Contreras wrote:\n> > Ævar Arnfjörð Bjarmason wrote:\n> >> On Thu, Jul 15 2021, Ævar Arnfjörð Bjarmason wrote:\n> >> > On Wed, Jul 14 2021, Felipe Contreras wrote:\n> >> >> [...]\n> >> >> @@ -2399,7 +2399,7 @@ test_expect_success 'sourcing the completion script clears cached --options' '\n> >> >>  \tverbose test -n \"$__gitcomp_builtin_checkout\" &&\n> >> >>  \t__gitcomp_builtin notes_edit &&\n> >> >>  \tverbose test -n \"$__gitcomp_builtin_notes_edit\" &&\n> >> >> -\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n> >> >> +\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n> >> >>  \tverbose test -z \"$__gitcomp_builtin_checkout\" &&\n> >> >>  \tverbose test -z \"$__gitcomp_builtin_notes_edit\"\n> >> >>  '\n> >> >>\n> >> >> diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\n> >> >> index bbd513bab0..784e523fd4 100755\n> >> >> --- a/t/t9903-bash-prompt.sh\n> >> >> +++ b/t/t9903-bash-prompt.sh\n> >> >> @@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n> >> >>  \n> >> >>  . ./lib-bash.sh\n> >> >>  \n> >> >> -. \"$GIT_BUILD_DIR/contrib/completion/git-prompt.sh\"\n> >> >> +. \"$GIT_BUILD_DIR/extra/completion/git-prompt.sh\"\n> >> >>  \n> >> >>  actual=\"$TRASH_DIRECTORY/actual\"\n> >> >>  c_red='\\\\[\\\\e[31m\\\\]'\n> >> >\n> >> > It's more of a \"for bonus points\", but a nic way to round-trip this\n> >> > would be to make this work with GIT_TEST_INSTALLED.\n> >> >\n> >> > I.e. source these relative to GIT_EXEC_PATH, not $GIT_BUILD_DIR, I think\n> >> > that just sourcing them as e.g.:\n> >> >\n> >> >     . git-completion.bash\n> >> >\n> >> > But the GIT_TEST_INSTALLED case is tricker, maybe we'd need to add a\n> >> > \"git --share-path\" :(\n> >> \n> >> I forgot to include this not-working patch, i.e. I've got no idea what\n> >> the \"something\" should be other than the harder thing of compiling\n> >> \"sharedir\" into git and making \"git --share-path\" work.\n> >\n> > I don't think there's a \"something\" that would make sense.\n> >\n> > It would be something like '/opt/git/bin/completion'?\n> \n> I think more importantly if they're going to be \"first-class\" components\n> that we have some native way of getting them to the user.\n\nYes, I already said --share-path would make sense [1] in your other\nreply.\n\n> I.e. once you install git being able to load them in your shell as:\n> \n>     . git-path\n>     . git-completion\n> \n> Or whatever, which means either putting them in $PATH (i.e. we'd drop\n> them in bin/ along with the non-dashed-built-ins like git-upload-pack\n> etc.), or something like:\n> \n>     . \"$(git --completion-path)\"/bash\n>     . \"$(git --completion-path)\"/zsh\n> \n> Or maybe:\n> \n>     . \"$(git --extras-path)\"/completion/bash.sh\n>     . \"$(git --extras-path)\"/prompt.sh\n> \n> ?\n\nBut that's not how completions should work.\n\nThere's a standard location for bash completions in order to be picked\nby bash-completion:\n\n  /usr/share/bash-completion/completions\n\nThis will be the case regardless of what --extras-path is.\n\nThe user *should not* be sourcing anything from there directly,\nbash-completion does that automatically.\n\nThis location depends by distribution, and the standard way to figure it\nout is:\n\n  pkg-config --variable=completionsdir bash-completion\n\nIf you don't have bash-completion insalled, *then* you would need to\nsource the completion file directly, but you cannot use pkg-config to\nfigure out that location, so you would need to use the default\n(/usr/share/bash-completion/completions).\n\nWe could install the completion twice (or provide a symlink):\n\n  /usr/share/bash-completion/completions/git\n  /usr/share/git-core/completion/bash.sh\n\nSo if the user doesn't have bash-completion installed, can do:\n\n  source \"$(git --extras-path)\"/completion/bash.sh\n\nInstead of the standard:\n\n  source /usr/share/bash-completion/completions/git\n\nBut *right now* the standard location is standard, distributions are\nusing it, and users are using it.\n\nMoreover, it seems a bit wasteful to have --exec-path, --html-path,\n--man-path, --info-path, --extra-path. Why not have --path=extra\ninstead?\n\nOnce again, I think this is a good idea, but it should be done\nseparately, and you yourself said \"for bonus points\".\n\n\nNot to mention my strong feeling that *even* if I implement this nice\nfeature, Junio will still ignore this series (as he ignores everything I\nsend), so I will be simply wasting my time implementing something that\nwill never be merged (just like he stood on the sidelines watching us\nimplement 6 versions of the man pager colorize patch just to say \"no\nthanks\" [2]).\n\nI'd be more than happy to add any other suggestions you might have, but\nlet's be honest: this is a patch we all will have be carrying ourselves\n(I have dozens of those), so I'd rather not add more complexity for a\nperfect solution that won't be applied.\n\nI'd rather aim for something that is good enough.\n\nCheers.\n\n[1] https://lore.kernel.org/git/60f0859399369_519c2083c@natae.notmuch/\n[2] https://lore.kernel.org/git/xmqq4ke8pig9.fsf@gitster.g/\n\n-- \nFelipe Contreras"},{"id":"430387","messageId":"20210716201427.4482-1-felipe.contreras@gmail.com","threadId":"56089","inReplyTo":"20210710234629.17197-1-felipe.contreras@gmail.com","subject":"[PATCH v4 0/1] extra: new concept of extra components","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-16T20:14:26Z","receivedAt":"2021-07-16T20:14:33Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"This patch series introduces the concept of extra components. These are\ncomponents which are not yet part of the core, but are good enough for\ndistributions to ship, and in fact: they already do.\n\nThis benefits everyone:\n\n 1. Distribution packagers that just want to do `make install`\n 2. People who download git's source code and just want to do\n    `make install`\n 3. Developers who have no idea what's production-level quality in\n    contrib/ and just want to do `make install`.\n\nFor now they'll have to do `make install install-extra`. But if the\nresult is deemed correct, we might choose to add \"install-extra\" to the\n\"install\" target.\n\nThe measuring stick I'm using to gauge if a component in contrib belongs\nin extra is simple: are we already running tests for them with\n'make test'? If the answer is \"yes, we do run tests\", then the answer is\n\"yes, it belongs in extra\".\n\nWe might want to move more components from contrib to extra once their\ntests are being run reliably.\n\nAnd we might move some components from the core which aren't really part\nof the core to extra, like gitk, git-gui, git-p4, and git-svn.\n\nFor now only part of contrib/completion is graduated to the new area.\n\nSince v3 I added .PHONY to the new targets as Ævar Arnfjörð suggetsed,\nand also added a bit for the explanation of extra from the cover letter\nto the commit message.\n\nFelipe Contreras (1):\n  completion: graduate out of contrib\n\n Makefile                                          | 11 +++++++++++\n {contrib => extra}/completion/git-completion.bash |  0\n {contrib => extra}/completion/git-completion.zsh  |  0\n {contrib => extra}/completion/git-prompt.sh       |  0\n t/t9902-completion.sh                             |  8 ++++----\n t/t9903-bash-prompt.sh                            |  2 +-\n 6 files changed, 16 insertions(+), 5 deletions(-)\n rename {contrib => extra}/completion/git-completion.bash (100%)\n rename {contrib => extra}/completion/git-completion.zsh (100%)\n rename {contrib => extra}/completion/git-prompt.sh (100%)\n\nRange-diff against v3:\n1:  3f44bc3253 ! 1:  07eb614ef7 completion: graduate out of contrib\n    @@ Commit message\n         move the completions out of contrib.\n     \n         Let's move them out of contrib and provide an installation target\n    -    install-extra.\n    +    install-extra which be a convenient target for package maintainers and\n    +    other people who install git themselves.\n    +\n    +    The measuring stick for what belongs in \"extra\" is simple: are we\n    +    already running tests for them with 'make test'? Currently only\n    +    part of completions fit that bill, but others could be added later.\n     \n         By default bash-completion installs the completions to\n         $(pkgdatadir)/completions, which is\n    -    $(prefix)/share/bash-completion/completions. And since most distributions do\n    -    not change this, it is obviously the right default that distributions\n    -    can override with bashcompdir.\n    +    $(prefix)/share/bash-completion/completions. And since most\n    +    distributions do not change this, it is obviously the right default that\n    +    distributions can override with bashcompdir.\n     \n         By default zsh looks for completions in\n         $(prefix)/share/zsh/site-functions.\n    @@ Makefile: htmldir_relative_SQ = $(subst ','\\'',$(htmldir_relative))\n      \n      SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n      TEST_SHELL_PATH_SQ = $(subst ','\\'',$(TEST_SHELL_PATH))\n    +@@ Makefile: endif\n    + \t./check_bindir \"z$$bindir\" \"z$$execdir\" \"$$bindir/git-add$X\"\n    + \n    + .PHONY: install-gitweb install-doc install-man install-man-perl install-html install-info install-pdf\n    ++.PHONY: install-extra install-completion\n    + .PHONY: quick-install-doc quick-install-man quick-install-html\n    + install-gitweb:\n    + \t$(MAKE) -C gitweb install\n     @@ Makefile: quick-install-man:\n      quick-install-html:\n      \t$(MAKE) -C Documentation quick-install-html\n-- \n2.32.0.40.gb9b36f9b52\n\n"},{"id":"430388","messageId":"20210716201427.4482-2-felipe.contreras@gmail.com","threadId":"56089","inReplyTo":"20210716201427.4482-1-felipe.contreras@gmail.com","subject":"[PATCH v4 1/1] completion: graduate out of contrib","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-16T20:14:27Z","receivedAt":"2021-07-16T20:14:34Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"These have been stable and widely used for quite a long time, they even\nhave tests outside of the contrib area, and most distributions ship\nthem, so they can be considered part of the core already.\n\nWe should be consistent and either we move the tests to contrib, or we\nmove the completions out of contrib.\n\nLet's move them out of contrib and provide an installation target\ninstall-extra which be a convenient target for package maintainers and\nother people who install git themselves.\n\nThe measuring stick for what belongs in \"extra\" is simple: are we\nalready running tests for them with 'make test'? Currently only\npart of completions fit that bill, but others could be added later.\n\nBy default bash-completion installs the completions to\n$(pkgdatadir)/completions, which is\n$(prefix)/share/bash-completion/completions. And since most\ndistributions do not change this, it is obviously the right default that\ndistributions can override with bashcompdir.\n\nBy default zsh looks for completions in\n$(prefix)/share/zsh/site-functions.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile                                          | 11 +++++++++++\n {contrib => extra}/completion/git-completion.bash |  0\n {contrib => extra}/completion/git-completion.zsh  |  0\n {contrib => extra}/completion/git-prompt.sh       |  0\n t/t9902-completion.sh                             |  8 ++++----\n t/t9903-bash-prompt.sh                            |  2 +-\n 6 files changed, 16 insertions(+), 5 deletions(-)\n rename {contrib => extra}/completion/git-completion.bash (100%)\n rename {contrib => extra}/completion/git-completion.zsh (100%)\n rename {contrib => extra}/completion/git-prompt.sh (100%)\n\ndiff --git a/Makefile b/Makefile\nindex 502e0c9a81..33402cc09d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -532,6 +532,7 @@ sharedir = $(prefix)/share\n gitwebdir = $(sharedir)/gitweb\n perllibdir = $(sharedir)/perl5\n localedir = $(sharedir)/locale\n+bashcompdir = $(sharedir)/bash-completion/completions\n template_dir = share/git-core/templates\n htmldir = $(prefix)/share/doc/git-doc\n ETC_GITCONFIG = $(sysconfdir)/gitconfig\n@@ -2015,6 +2016,7 @@ bindir_relative_SQ = $(subst ','\\'',$(bindir_relative))\n mandir_SQ = $(subst ','\\'',$(mandir))\n mandir_relative_SQ = $(subst ','\\'',$(mandir_relative))\n infodir_relative_SQ = $(subst ','\\'',$(infodir_relative))\n+sharedir_SQ = $(subst ','\\'',$(sharedir))\n perllibdir_SQ = $(subst ','\\'',$(perllibdir))\n localedir_SQ = $(subst ','\\'',$(localedir))\n localedir_relative_SQ = $(subst ','\\'',$(localedir_relative))\n@@ -2025,6 +2027,7 @@ htmldir_relative_SQ = $(subst ','\\'',$(htmldir_relative))\n prefix_SQ = $(subst ','\\'',$(prefix))\n perllibdir_relative_SQ = $(subst ','\\'',$(perllibdir_relative))\n gitwebdir_SQ = $(subst ','\\'',$(gitwebdir))\n+bashcompdir_SQ = $(subst ','\\'',$(bashcompdir))\n \n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n TEST_SHELL_PATH_SQ = $(subst ','\\'',$(TEST_SHELL_PATH))\n@@ -3079,6 +3082,7 @@ endif\n \t./check_bindir \"z$$bindir\" \"z$$execdir\" \"$$bindir/git-add$X\"\n \n .PHONY: install-gitweb install-doc install-man install-man-perl install-html install-info install-pdf\n+.PHONY: install-extra install-completion\n .PHONY: quick-install-doc quick-install-man quick-install-html\n install-gitweb:\n \t$(MAKE) -C gitweb install\n@@ -3112,6 +3116,13 @@ quick-install-man:\n quick-install-html:\n \t$(MAKE) -C Documentation quick-install-html\n \n+install-extra: install-completion\n+\n+install-completion:\n+\t$(INSTALL) -D -m 644 extra/completion/git-completion.bash '$(DESTDIR_SQ)$(bashcompdir_SQ)'/git\n+\t$(INSTALL) -D -m 644 extra/completion/git-prompt.sh '$(DESTDIR_SQ)$(sharedir_SQ)'/git-core/git-prompt.sh\n+\t$(INSTALL) -D -m 644 extra/completion/git-completion.zsh '$(DESTDIR_SQ)$(sharedir_SQ)'/zsh/site-functions/_git\n+\n \n \n ### Maintainer's dist rules\ndiff --git a/contrib/completion/git-completion.bash b/extra/completion/git-completion.bash\nsimilarity index 100%\nrename from contrib/completion/git-completion.bash\nrename to extra/completion/git-completion.bash\ndiff --git a/contrib/completion/git-completion.zsh b/extra/completion/git-completion.zsh\nsimilarity index 100%\nrename from contrib/completion/git-completion.zsh\nrename to extra/completion/git-completion.zsh\ndiff --git a/contrib/completion/git-prompt.sh b/extra/completion/git-prompt.sh\nsimilarity index 100%\nrename from contrib/completion/git-prompt.sh\nrename to extra/completion/git-prompt.sh\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex cb057ef161..32601b755d 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -36,7 +36,7 @@ complete ()\n GIT_TESTING_ALL_COMMAND_LIST='add checkout check-attr rebase ls-files'\n GIT_TESTING_PORCELAIN_COMMAND_LIST='add checkout rebase'\n \n-. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\"\n+. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\"\n \n # We don't need this function to actually join words or do anything special.\n # Also, it's cleaner to avoid touching bash's internal completion variables.\n@@ -2383,14 +2383,14 @@ test_expect_success 'git clone --config= - value' '\n test_expect_success 'sourcing the completion script clears cached commands' '\n \t__git_compute_all_commands &&\n \tverbose test -n \"$__git_all_commands\" &&\n-\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n+\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n \tverbose test -z \"$__git_all_commands\"\n '\n \n test_expect_success 'sourcing the completion script clears cached merge strategies' '\n \t__git_compute_merge_strategies &&\n \tverbose test -n \"$__git_merge_strategies\" &&\n-\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n+\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n \tverbose test -z \"$__git_merge_strategies\"\n '\n \n@@ -2399,7 +2399,7 @@ test_expect_success 'sourcing the completion script clears cached --options' '\n \tverbose test -n \"$__gitcomp_builtin_checkout\" &&\n \t__gitcomp_builtin notes_edit &&\n \tverbose test -n \"$__gitcomp_builtin_notes_edit\" &&\n-\t. \"$GIT_BUILD_DIR/contrib/completion/git-completion.bash\" &&\n+\t. \"$GIT_BUILD_DIR/extra/completion/git-completion.bash\" &&\n \tverbose test -z \"$__gitcomp_builtin_checkout\" &&\n \tverbose test -z \"$__gitcomp_builtin_notes_edit\"\n '\ndiff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\nindex bbd513bab0..784e523fd4 100755\n--- a/t/t9903-bash-prompt.sh\n+++ b/t/t9903-bash-prompt.sh\n@@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n \n . ./lib-bash.sh\n \n-. \"$GIT_BUILD_DIR/contrib/completion/git-prompt.sh\"\n+. \"$GIT_BUILD_DIR/extra/completion/git-prompt.sh\"\n \n actual=\"$TRASH_DIRECTORY/actual\"\n c_red='\\\\[\\\\e[31m\\\\]'\n-- \n2.32.0.40.gb9b36f9b52\n\n"}]}