On Mon, Nov 21, 2022 at 2:43 PM Junio C Hamano <gitster@xxxxxxxxx> wrote: > > "Yoichi Nakayama via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > > > +You can use the optional argument 'stdout' to print the listing to > > +standard output. You can use it with M-x grep on Emacs. > > It is unclear what happens when you do not give 'stdout' from the > above description. You say 'stdout' is a way to tell the command > "to print the listing to standard output", but what is expected to > follow that sentence is left unsaid (i.e. "you can give 'stdout' to > print to stdout, INSTEAD OF DOING X"). I agree. I'll add "instead of feeding it to the editor". > > +# In Emacs, M-x grep and invoke "git jump stdout <mode>" > > +Run grep (like this): git jump stdout diff > > the command line structure of "git jump" being > > git jump <mode> [<args>] > > where <mode> is one of 'diff', 'merge', 'grep', it somehow feels > very strange to insert an optional new word, that is not a dashed > option, before the <mode>. "git jump --stdout diff" might be less > surprising, but I dunno. > > But I think this is a good idea. In fact, it almost feels that the > interface to produce the list of "$file:$line: <blah>" that this > "stdout" mode gives should have been in the command as the lowest > level basic primitive, upon which the feature to drive a specific > editor using such an output file should have been built, and the > current code is backwards in that sense. Exposing that lower level > primitive directly is a welcome addition. Thank you for your thoughtful consideration. The value of git-jump is to launch the editor quickly from the command line. I think it's rare to manually use the additional option (e.g. M-x grep in Emacs). Therefore, I think there is not much needs to expose it directly. I'll change it to less surprising form "--stdout". -- Yoichi NAKAYAMA