Re: [PATCH 3/6] run-command: optimize out useless shell calls
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Dec 31, 2009, 21:41 UTC
- Message-ID
- <200912312241.37895.j6t@kdbg.org>
- In-Reply-To
- <7v4on7x6w1.fsf@alter.siamese.dyndns.org>
On Donnerstag, 31. Dezember 2009, Junio C Hamano wrote:
Show 17 quoted lines
> It is a cute idea that covers 70-80% of the cases, as you also have to > assume that you don't have to specify your own pager on a path with IFS > (e.g. "Program files" in your example) and give your parameter to the > pager at the same time, e.g. > > PAGER="C:\Program Files\cygwin\bin\less -FRSX" > > Because it has its own LESS environment to set FRSX and you can get away > with: > > PAGER="C:\Program Files\cygwin\bin\less" > LESS=FRSX > > "less" is not a representative example for this issue. In real life I > suspect that custom programs that we don't ship with git (or you don't > ship with msysgit) would lack such a workaround, (and that is why I didn't > say "98% of the cases").
OTOH, once you see that you would have to set
PAGER: C:\Program Files\cygwin\bin\less -FRSX
(I'm not using shell syntax here; think of a dialog that has name and value in separate edit boxes) then it is rather obvious that this cannot work. If you are clever (and you probably are - after all, you are modifying something esoteric: the environment!), then you will have heard about the magic double-quotes, and you will write this as
PAGER: "C:\Program Files\cygwin\bin\less" -FRSX
instead, and it will work as intended.
Granted, "less" is not representative.
GIT_EDITOR: "C:\Program Files\Notepad++\notepad++" -multiInst
is probably more realistic (but I didn't test it).
-- Hannes