git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC/WIP/POC] git-gui: grep prototype

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 14, 2010, 22:09 UTC
Message-ID
<20101114220932.GE16413@burratino>
In-Reply-To
<AANLkTiktg4aZ7VfdXUT9XF4RK7MuCvzevB5jSRaNiE1L@mail.gmail.com>
Bert Wesarg wrote:
> On Sun, Nov 14, 2010 at 22:54, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 18 quoted lines
>> This sounds like an excellent sort of thing to add to git grep -O, too
>> (which currently has very limited support for editors' line number
>> features).  But what will it do with typical non-git-specific setups
>> like
>>
>>        VISUAL=vim
>>
>> or
>>
>>        EDITOR="gvim --nofork"
>>
>> ?
>>
>> Do existing editors support LINENUMBER in the environment?
>
> I don't expect this, I have a wrapper script around my editor to scan
> the environment for these variables and pass the block/non-block
> option to the editor.
In that case, perhaps something like
	GIT_EDITOR=$(git var GIT_EDITOR)
	set -- --open-file-named-in-the-environment
	eval "$GIT_EDITOR" '"$@"' 

would be appropriate? This way, existing editors like vi, ed, and emacs fail:

	$ ed --fjdkaslfjdas
	ed: unrecognized option `--fjdkaslfjdas'
rather than opening a new, empty file.
Previous: Bert WesargNext: Bert Wesarg
Message 4 of 9 in “git-gui: grep prototype”
  1. git-gui: grep prototypeBert Wesarg, Nov 14, 2010
  2. Jonathan NiederNov 14, 2010
  3. Bert WesargNov 14, 2010
  4. Jonathan NiederNov 14, 2010
  5. Bert WesargNov 14, 2010
  6. Jonathan NiederNov 14, 2010
  7. Bert WesargNov 19, 2010
  8. Jonathan NiederNov 19, 2010
  9. Bert WesargNov 19, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.