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

Re: interactive rebase editor pathname variable

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 14, 2010, 07:59 UTC
Message-ID
<20100514075913.GA3690@progeny.tock>
In-Reply-To
<hshglg$p2q$1@dough.gmane.org>
Hi Neal,
Neal Kreitzinger wrote:
Show 6 quoted lines
> git-rebase -i passes an absolute pathname to the 
> core.editor, e.g. 
> "home/someuser/someworkingtree/.git/rebase-merge/git-rebase-todo".  This 
> causes problems in our shop because our proprietary editor cannot handle 
> pathnames beginning with a period (it translates the period to a slash) and 
> therefore our entry for core.editor is 'someeditor "$PWD/$1"'.
For your example, git uses the shell to run the following command.
  someeditor "$PWD/$1" "$@"
I would suggest something like the following instead.
  [core]
	editor = "sh -c '\
		case \"$1\" in \
		/*|[A-Za-z]:*) file=\"$1\";; \
		*) file=\"$(pwd)/$1\";; \
		esac; \
		someruntime someditor \"$file\"' -"

Hope that helps, Jonathan

Previous: Neal KreitzingerNext: Bert Wesarg
Message 2 of 3 in “interactive rebase editor pathname variable”
  1. Neal KreitzingerMay 13, 2010
  2. Jonathan NiederMay 14, 2010
  3. Bert WesargMay 14, 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.