Re: [PATCH 4/4] grep -O: allow optional argument specifying the pager (or editor)
- From
Paolo Bonzini <bonzini@gnu.org>
- Date
- Jun 13, 2010, 17:04 UTC
- Message-ID
- <AANLkTikny5zhO18cbGvq2zcMOdfAcDbAG6LiOLGTtepv@mail.gmail.com>
- In-Reply-To
- <7vvd9mevqy.fsf@alter.siamese.dyndns.org>
Show 6 quoted lines
>> - [-O | --open-files-in-pager] >> + [(-O | --open-files-in-pager) [<pager>]] > > Hmm, does "git grep -e Heh -O frotz" look for Heh and show in the frotz > pager, or does it look for Heh in paths under frotz/ directory and show > hits in the default pager?
The latter.
Show 11 quoted lines
>> + const char *show_in_pager = NULL, *default_pager = "dummy"; > > If there were another instance of constant string "dummy" elsewhere in the > program, is a clever compiler-linker combo allowed to optimize memory use > by allocating one instance of such a string and pointing default_pager > pointer to it? IOW, if the patch were: > >> + const char *show_in_pager = NULL, *default_pager = "dummy"; >> + const char *another_dummy = "dummy"; > > could another_dummy and default_pager start out with the same value?
In the same file, the compiler will do it already today. In another file, no (except if it does link-time optimization of course).
Paolo