Re: [PATCH 1/2] Introduce git-run-with-user-path helper program.
- From
Junio C Hamano <junkio@cox.net>
- Date
- May 17, 2005, 22:13 UTC
- Message-ID
- <7vzmutqz5f.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20050517213752.GO7136@pasky.ji.cz>
>>>>> "PB" == Petr Baudis <pasky@ucw.cz> writes:
PB> But that won't work good enough for me. E.g. when committing in a PB> subdirectory, I want to commit only changes made in the subdirectory, PB> etc.
Assuming that you have something that lets you commit selected files when you are at the top level (say cg-commit), and further assuming that today it only works from the toplevel, that is:
$ pwd
/usr/src/linux
$ cg-commit fs/ext?/Makefileworks today, what I am saying is:
$ pwd
/usr/src/linux/fs
$ git-run-with-user-path cg-commit -- ext?/Makefilewould work.
Usually the command like cg-commit would take non-path parameters, so if this works today:
$ pwd
/usr/src/linux
$ cg-commit -m 'Changed Makefile' fs/ext?/Makefilethen:
$ pwd
/usr/src/linux/fs
$ git-run-with-user-path cg-commit -m 'Changed Makefile' -- ext?/Makefilewould work.
Once you have a core that works well but only at the top directory level, then you can make a thin wrapper using git-run-with-user-path to make that work equally well with the filesystem path from subdirectories. And the core-ish thing that only works at the top directory level does not need to worry about finding .git/ anymore, which is the whole point of what this helper is giving you.
BTW, I am wondering if your choice of cg-commit as an example (as opposed to something else like diff or add) is a flamebait or just an innocent random example ;-)?