Re: [PATCH] introduce git root
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Dec 1, 2014, 04:17 UTC
- Message-ID
- <CAP8UFD2jES1i+6zOt1gXqTWFy1UHu2GBwAisQktd_Ymbj9Db2g@mail.gmail.com>
- In-Reply-To
- <xmqqd284rryz.fsf@gitster.dls.corp.google.com>
On Mon, Dec 1, 2014 at 4:04 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
> > If I were redoing this today, I would probably nominate the "git" > potty as such a "kitchen synk" command. We have "--man-path" that > shows the location of the manual pages, "--exec-path[=path]" that > either shows or allows us to override the path to the subcommands, > and "--show-prefix", "--show-toplevel", and friends may feel quite > at home there.
I wonder if we could reuse "git config" which is already a "kitchen synk" command to get/set a lot of parameters. Maybe we could dedicate a "git" or "virtual" or "proc" or "sys" (like /proc or /sys in Linux) namespace for these special config parameters that would not necessarily reflect something in the config file.
"git config git.man-path" would be the same as "git --man-path". "git config git.root" would be the same as "git rev-parse --show-toplevel". "git config git.exec-path mypath" would allow us to override the path to the subcommands, probably by saving something in the config file.
If we wanted for example to try just once a special exec-path we could use:
git -c git.exec-path=/path/to/git-foo foo
Best, Christian.