git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* -C option with pull doesn't seem to be respected in aliases in git 2.6.4.
@ 2015-12-18  1:35 Cameron Esfahani
  2015-12-21  1:17 ` Duy Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Cameron Esfahani @ 2015-12-18  1:35 UTC (permalink / raw)
  To: git

I have git project checked out at ~/llvm.  Inside of there, inside of a “tools” directory, I have another project checked out as “lldb”:

~/llvm/tools/lldb

I wrote an alias which would help me update all my projects:

	all = !find . -type d -name .git | sed 's:/.git::' | xargs -I{} -t git -C {} $1 && :

This would allow me to be inside of ~/llvm and type "git all pull" and get all my projects updated.

It seems that at some point this broke.  If try to use this alias under git 2.6.4, it only updates the llvm project.

The interesting thing is that if I pass fetch, instead of pull: "git all fetch", then it seems to work correctly.

Here’s the GIT_TRACE output for “git all pull” when in ~/llvm:

[llvm (master)]$ GIT_TRACE=1 git all pull
17:28:43.938363 git.c:558               trace: exec: 'git-all' 'pull'
17:28:43.938813 run-command.c:335       trace: run_command: 'git-all' 'pull'
17:28:43.940167 run-command.c:335       trace: run_command: 'find . -type d -name .git | sed '\''s:/.git::'\'' | xargs -I{} -t git -C {} $1 && :' 'pull'
17:28:43.940665 run-command.c:195       trace: exec: '/bin/sh' '-c' 'find . -type d -name .git | sed '\''s:/.git::'\'' | xargs -I{} -t git -C {} $1 && : "$@"' 'find . -type d -name .git | sed '\''s:/.git::'\'' | xargs -I{} -t git -C {} $1 && :' 'pull'
git -C . pull
17:28:44.191670 git.c:558               trace: exec: 'git-pull'
17:28:44.192253 run-command.c:335       trace: run_command: 'git-pull'
17:28:44.197094 git.c:348               trace: built-in: git 'rev-parse' '--parseopt' '--stuck-long' '--'
17:28:44.203237 git.c:348               trace: built-in: git 'rev-parse' '--git-dir'
17:28:44.207297 git.c:348               trace: built-in: git 'rev-parse' '--git-path' 'objects'
17:28:44.210819 git.c:348               trace: built-in: git 'rev-parse' '--is-bare-repository'
17:28:44.213666 git.c:348               trace: built-in: git 'rev-parse' '--show-toplevel'
17:28:44.216954 git.c:348               trace: built-in: git 'ls-files' '-u'
17:28:44.227604 git.c:348               trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
17:28:44.233503 git.c:348               trace: built-in: git 'config' 'branch.master.rebase'
17:28:44.244334 git.c:348               trace: built-in: git 'config' 'pull.ff'
17:28:44.247510 git.c:348               trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD'
17:28:44.250365 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'HEAD'
17:28:44.253328 git.c:348               trace: built-in: git 'update-index' '-q' '--ignore-submodules' '--refresh'
17:28:44.282912 git.c:348               trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
17:28:44.317433 git.c:348               trace: built-in: git 'diff-index' '--cached' '--quiet' '--ignore-submodules' 'HEAD' '--'
17:28:44.332900 git.c:348               trace: built-in: git 'rev-parse' '-q' '--git-dir'
17:28:44.366055 git.c:348               trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD'
17:28:44.369245 git.c:348               trace: built-in: git 'fetch' '--update-head-ok'
17:28:44.380626 run-command.c:335       trace: run_command: 'git-remote-http' 'origin' 'http://llvm.org/git/llvm.git'
17:28:44.575908 run-command.c:335       trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
17:28:44.583303 run-command.c:335       trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all'
17:28:44.583756 exec_cmd.c:178          trace: exec: 'git' 'rev-list' '--objects' '--stdin' '--not' '--all'
17:28:44.585457 git.c:348               trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all'
17:28:44.591116 run-command.c:335       trace: run_command: 'gc' '--auto'
17:28:44.591576 exec_cmd.c:178          trace: exec: 'git' 'gc' '--auto'
17:28:44.593252 git.c:348               trace: built-in: git 'gc' '--auto'
17:28:44.597284 git.c:348               trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD'
17:28:44.604021 git.c:348               trace: built-in: git 'show-branch' '--merge-base' 'refs/heads/master' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0'
17:28:44.610870 git.c:348               trace: built-in: git 'rev-parse' '--parseopt' '--stuck-long' '--' '--onto' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0'
17:28:44.617283 git.c:348               trace: built-in: git 'rev-parse' '--git-dir'
17:28:44.621510 git.c:348               trace: built-in: git 'rev-parse' '--git-path' 'objects'
17:28:44.626588 git.c:348               trace: built-in: git 'rev-parse' '--is-bare-repository'
17:28:44.629515 git.c:348               trace: built-in: git 'rev-parse' '--show-toplevel'
17:28:44.633673 git.c:348               trace: built-in: git 'config' '--bool' 'rebase.stat'
17:28:44.636888 git.c:348               trace: built-in: git 'config' '--bool' 'rebase.autostash'
17:28:44.640171 git.c:348               trace: built-in: git 'config' '--bool' 'rebase.autosquash'
17:28:44.644466 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0^0'
17:28:44.649511 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0^0'
17:28:44.653787 git.c:348               trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
17:28:44.659338 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'HEAD'
17:28:44.662978 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'HEAD'
17:28:44.666002 git.c:348               trace: built-in: git 'update-index' '-q' '--ignore-submodules' '--refresh'
17:28:44.698982 git.c:348               trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
17:28:44.735732 git.c:348               trace: built-in: git 'diff-index' '--cached' '--quiet' '--ignore-submodules' 'HEAD' '--'
17:28:44.752604 git.c:348               trace: built-in: git 'merge-base' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0'
17:28:44.758075 git.c:348               trace: built-in: git 'rev-list' '--parents' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0..ce00641ac5f4ca2a073b732a75169037a2d9bef0'
17:28:44.765516 git.c:558               trace: exec: 'git-sh-i18n--envsubst' '--variables' 'Current branch $branch_name is up to date.'
17:28:44.766008 run-command.c:335       trace: run_command: 'git-sh-i18n--envsubst' '--variables' 'Current branch $branch_name is up to date.'
17:28:44.770269 git.c:558               trace: exec: 'git-sh-i18n--envsubst' 'Current branch $branch_name is up to date.'
17:28:44.770702 run-command.c:335       trace: run_command: 'git-sh-i18n--envsubst' 'Current branch $branch_name is up to date.'
Current branch master is up to date.
17:28:44.775429 git.c:348               trace: built-in: git 'gc' '--auto'
git -C ./tools/lldb pull
17:28:48.377109 git.c:558               trace: exec: 'git-pull'
17:28:48.377647 run-command.c:335       trace: run_command: 'git-pull'
17:28:48.384848 git.c:348               trace: built-in: git 'rev-parse' '--parseopt' '--stuck-long' '--'
17:28:48.391621 git.c:348               trace: built-in: git 'rev-parse' '--git-dir'
17:28:48.396502 git.c:348               trace: built-in: git 'rev-parse' '--git-path' 'objects'
17:28:48.400801 git.c:348               trace: built-in: git 'rev-parse' '--is-bare-repository'
17:28:48.403695 git.c:348               trace: built-in: git 'rev-parse' '--show-toplevel'
17:28:48.407029 git.c:348               trace: built-in: git 'ls-files' '-u'
17:28:48.418794 git.c:348               trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
17:28:48.426330 git.c:348               trace: built-in: git 'config' 'branch.master.rebase'
17:28:48.437204 git.c:348               trace: built-in: git 'config' 'pull.ff'
17:28:48.440558 git.c:348               trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD'
17:28:48.444038 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'HEAD'
17:28:48.448308 git.c:348               trace: built-in: git 'update-index' '-q' '--ignore-submodules' '--refresh'
17:28:48.484990 git.c:348               trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
17:28:48.514798 git.c:348               trace: built-in: git 'diff-index' '--cached' '--quiet' '--ignore-submodules' 'HEAD' '--'
17:28:48.526355 git.c:348               trace: built-in: git 'rev-parse' '-q' '--git-dir'
17:28:48.560625 git.c:348               trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD'
17:28:48.565375 git.c:348               trace: built-in: git 'fetch' '--update-head-ok'
17:28:48.579800 run-command.c:335       trace: run_command: 'git-remote-http' 'origin' 'http://llvm.org/git/llvm.git'
17:28:48.829976 run-command.c:335       trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
17:28:48.837240 run-command.c:335       trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all'
17:28:48.837793 exec_cmd.c:178          trace: exec: 'git' 'rev-list' '--objects' '--stdin' '--not' '--all'
17:28:48.839494 git.c:348               trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all'
17:28:48.844913 run-command.c:335       trace: run_command: 'gc' '--auto'
17:28:48.845464 exec_cmd.c:178          trace: exec: 'git' 'gc' '--auto'
17:28:48.847145 git.c:348               trace: built-in: git 'gc' '--auto'
17:28:48.851173 git.c:348               trace: built-in: git 'rev-parse' '-q' '--verify' 'HEAD'
17:28:48.857550 git.c:348               trace: built-in: git 'show-branch' '--merge-base' 'refs/heads/master' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0'
17:28:48.864262 git.c:348               trace: built-in: git 'rev-parse' '--parseopt' '--stuck-long' '--' '--onto' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0'
17:28:48.870801 git.c:348               trace: built-in: git 'rev-parse' '--git-dir'
17:28:48.875849 git.c:348               trace: built-in: git 'rev-parse' '--git-path' 'objects'
17:28:48.880555 git.c:348               trace: built-in: git 'rev-parse' '--is-bare-repository'
17:28:48.883537 git.c:348               trace: built-in: git 'rev-parse' '--show-toplevel'
17:28:48.887435 git.c:348               trace: built-in: git 'config' '--bool' 'rebase.stat'
17:28:48.890846 git.c:348               trace: built-in: git 'config' '--bool' 'rebase.autostash'
17:28:48.894187 git.c:348               trace: built-in: git 'config' '--bool' 'rebase.autosquash'
17:28:48.899616 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0^0'
17:28:48.905231 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0^0'
17:28:48.909854 git.c:348               trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
17:28:48.914188 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'HEAD'
17:28:48.918339 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'HEAD'
17:28:48.923372 git.c:348               trace: built-in: git 'update-index' '-q' '--ignore-submodules' '--refresh'
17:28:48.957439 git.c:348               trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
17:28:48.988790 git.c:348               trace: built-in: git 'diff-index' '--cached' '--quiet' '--ignore-submodules' 'HEAD' '--'
17:28:49.000859 git.c:348               trace: built-in: git 'merge-base' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0'
17:28:49.005472 git.c:348               trace: built-in: git 'rev-list' '--parents' 'ce00641ac5f4ca2a073b732a75169037a2d9bef0..ce00641ac5f4ca2a073b732a75169037a2d9bef0'
17:28:49.011492 git.c:558               trace: exec: 'git-sh-i18n--envsubst' '--variables' 'Current branch $branch_name is up to date.'
17:28:49.011931 run-command.c:335       trace: run_command: 'git-sh-i18n--envsubst' '--variables' 'Current branch $branch_name is up to date.'
17:28:49.016616 git.c:558               trace: exec: 'git-sh-i18n--envsubst' 'Current branch $branch_name is up to date.'
17:28:49.017127 run-command.c:335       trace: run_command: 'git-sh-i18n--envsubst' 'Current branch $branch_name is up to date.'
Current branch master is up to date.
17:28:49.023390 git.c:348               trace: built-in: git 'gc' '—auto'

As you can see, the URL for “git-remote-http” in both cases is the same.

Here’s the same output when I don’t use my alias, and just explicitly type “git -C ./tools/lldb pull”:

[llvm (master)]$ GIT_TRACE=1 git -C ./tools/lldb pull
17:33:32.719929 git.c:348               trace: built-in: git 'pull'
17:33:32.736277 run-command.c:343       trace: run_command: 'merge-base' '--fork-point' 'refs/remotes/origin/master' 'master'
17:33:32.746115 run-command.c:343       trace: run_command: 'fetch' '--update-head-ok'
17:33:32.746678 exec_cmd.c:128          trace: exec: 'git' 'fetch' '--update-head-ok'
17:33:32.749630 git.c:348               trace: built-in: git 'fetch' '--update-head-ok'
17:33:32.755626 run-command.c:343       trace: run_command: 'git-remote-http' 'origin' 'http://llvm.org/git/lldb.git'
17:33:32.907411 run-command.c:343       trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
17:33:32.914960 run-command.c:343       trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all'
17:33:32.915633 exec_cmd.c:128          trace: exec: 'git' 'rev-list' '--objects' '--stdin' '--not' '--all'
17:33:32.917963 git.c:348               trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all'
17:33:32.921940 run-command.c:343       trace: run_command: 'gc' '--auto'
17:33:32.922467 exec_cmd.c:128          trace: exec: 'git' 'gc' '--auto'
17:33:32.925462 git.c:348               trace: built-in: git 'gc' '--auto'
17:33:32.927842 run-command.c:343       trace: run_command: 'rebase' '--onto' '8c27fea58aad24c89280b97997e11b8bfdda919c' '8c27fea58aad24c89280b97997e11b8bfdda919c'
17:33:32.928329 exec_cmd.c:128          trace: exec: 'git' 'rebase' '--onto' '8c27fea58aad24c89280b97997e11b8bfdda919c' '8c27fea58aad24c89280b97997e11b8bfdda919c'
17:33:32.930466 git.c:560               trace: exec: 'git-rebase' '--onto' '8c27fea58aad24c89280b97997e11b8bfdda919c' '8c27fea58aad24c89280b97997e11b8bfdda919c'
17:33:32.930901 run-command.c:343       trace: run_command: 'git-rebase' '--onto' '8c27fea58aad24c89280b97997e11b8bfdda919c' '8c27fea58aad24c89280b97997e11b8bfdda919c'
17:33:32.937571 git.c:348               trace: built-in: git 'rev-parse' '--parseopt' '--stuck-long' '--' '--onto' '8c27fea58aad24c89280b97997e11b8bfdda919c' '8c27fea58aad24c89280b97997e11b8bfdda919c'
17:33:32.944701 git.c:348               trace: built-in: git 'rev-parse' '--git-dir'
17:33:32.949832 git.c:348               trace: built-in: git 'rev-parse' '--git-path' 'objects'
17:33:32.954805 git.c:348               trace: built-in: git 'rev-parse' '--is-bare-repository'
17:33:32.959788 git.c:348               trace: built-in: git 'rev-parse' '--show-toplevel'
17:33:32.964319 git.c:348               trace: built-in: git 'config' '--bool' 'rebase.stat'
17:33:32.968482 git.c:348               trace: built-in: git 'config' '--bool' 'rebase.autostash'
17:33:32.972293 git.c:348               trace: built-in: git 'config' '--bool' 'rebase.autosquash'
17:33:32.977557 git.c:348               trace: built-in: git 'rev-parse' '--verify' '8c27fea58aad24c89280b97997e11b8bfdda919c^0'
17:33:32.983348 git.c:348               trace: built-in: git 'rev-parse' '--verify' '8c27fea58aad24c89280b97997e11b8bfdda919c^0'
17:33:32.990145 git.c:348               trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
17:33:32.995278 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'HEAD'
17:33:32.999987 git.c:348               trace: built-in: git 'rev-parse' '--verify' 'HEAD'
17:33:33.004018 git.c:348               trace: built-in: git 'update-index' '-q' '--ignore-submodules' '--refresh'
17:33:33.016616 git.c:348               trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
17:33:33.029256 git.c:348               trace: built-in: git 'diff-index' '--cached' '--quiet' '--ignore-submodules' 'HEAD' '--'
17:33:33.036863 git.c:348               trace: built-in: git 'merge-base' '8c27fea58aad24c89280b97997e11b8bfdda919c' '8c27fea58aad24c89280b97997e11b8bfdda919c'
17:33:33.043280 git.c:348               trace: built-in: git 'rev-list' '--parents' '8c27fea58aad24c89280b97997e11b8bfdda919c..8c27fea58aad24c89280b97997e11b8bfdda919c'
17:33:33.050406 git.c:560               trace: exec: 'git-sh-i18n--envsubst' '--variables' 'Current branch $branch_name is up to date.'
17:33:33.050965 run-command.c:343       trace: run_command: 'git-sh-i18n--envsubst' '--variables' 'Current branch $branch_name is up to date.'
17:33:33.058976 git.c:560               trace: exec: 'git-sh-i18n--envsubst' 'Current branch $branch_name is up to date.'
17:33:33.059502 run-command.c:343       trace: run_command: 'git-sh-i18n--envsubst' 'Current branch $branch_name is up to date.'
Current branch master is up to date.
17:33:33.066886 git.c:348               trace: built-in: git 'gc' '--auto'

Cameron Esfahani
dirty@apple.com

"Americans are very skilled at creating a custom meaning from something that's mass-produced."

Ann Powers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: -C option with pull doesn't seem to be respected in aliases in git 2.6.4.
  2015-12-18  1:35 -C option with pull doesn't seem to be respected in aliases in git 2.6.4 Cameron Esfahani
@ 2015-12-21  1:17 ` Duy Nguyen
  2015-12-21  9:57   ` Duy Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Duy Nguyen @ 2015-12-21  1:17 UTC (permalink / raw)
  To: Cameron Esfahani; +Cc: Git Mailing List, Paul Tan

On Fri, Dec 18, 2015 at 8:35 AM, Cameron Esfahani <dirty@apple.com> wrote:
> I have git project checked out at ~/llvm.  Inside of there, inside of a “tools” directory, I have another project checked out as “lldb”:
>
> ~/llvm/tools/lldb
>
> I wrote an alias which would help me update all my projects:
>
>         all = !find . -type d -name .git | sed 's:/.git::' | xargs -I{} -t git -C {} $1 && :
>
> This would allow me to be inside of ~/llvm and type "git all pull" and get all my projects updated.
>
> It seems that at some point this broke.  If try to use this alias under git 2.6.4, it only updates the llvm project.
>
> The interesting thing is that if I pass fetch, instead of pull: "git all fetch", then it seems to work correctly.

It would help if you could bisect this to the first broken commit (or
at least one version that works). git-pull was rewritten in C in
2.6.0, so this could be a regression. If you try a version before that
and the problem remains, then it's not the git-pull rewrite. Another
suspect is c056261 (git potty: restore environments after alias
expansion - 2014-06-08), since v2.1.0.
-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: -C option with pull doesn't seem to be respected in aliases in git 2.6.4.
  2015-12-21  1:17 ` Duy Nguyen
@ 2015-12-21  9:57   ` Duy Nguyen
  0 siblings, 0 replies; 3+ messages in thread
From: Duy Nguyen @ 2015-12-21  9:57 UTC (permalink / raw)
  To: Cameron Esfahani; +Cc: Git Mailing List, Paul Tan

On Mon, Dec 21, 2015 at 8:17 AM, Duy Nguyen <pclouds@gmail.com> wrote:
> On Fri, Dec 18, 2015 at 8:35 AM, Cameron Esfahani <dirty@apple.com> wrote:
>> I have git project checked out at ~/llvm.  Inside of there, inside of a “tools” directory, I have another project checked out as “lldb”:
>>
>> ~/llvm/tools/lldb
>>
>> I wrote an alias which would help me update all my projects:
>>
>>         all = !find . -type d -name .git | sed 's:/.git::' | xargs -I{} -t git -C {} $1 && :
>>
>> This would allow me to be inside of ~/llvm and type "git all pull" and get all my projects updated.
>>
>> It seems that at some point this broke.  If try to use this alias under git 2.6.4, it only updates the llvm project.
>>
>> The interesting thing is that if I pass fetch, instead of pull: "git all fetch", then it seems to work correctly.

Because the difference between git-fetch and git-pull in git.c is
NEED_WORK_TREE. Can you try to unset GIT_WORK_TREE before "find"? This
could be yet another regression from d95138e (setup: set env
$GIT_WORK_TREE when work tree is set, like $GIT_DIR - 2015-06-26)
-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-21  9:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-18  1:35 -C option with pull doesn't seem to be respected in aliases in git 2.6.4 Cameron Esfahani
2015-12-21  1:17 ` Duy Nguyen
2015-12-21  9:57   ` Duy Nguyen

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).