git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Neal Kreitzinger <neal@rsss.com>
Cc: git@vger.kernel.org
Subject: Re: interactive rebase editor pathname variable
Date: Fri, 14 May 2010 02:59:14 -0500	[thread overview]
Message-ID: <20100514075913.GA3690@progeny.tock> (raw)
In-Reply-To: <hshglg$p2q$1@dough.gmane.org>

Hi Neal,

Neal Kreitzinger wrote:

> 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

  reply	other threads:[~2010-05-14  7:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13 18:32 interactive rebase editor pathname variable Neal Kreitzinger
2010-05-14  7:59 ` Jonathan Nieder [this message]
2010-05-14 12:49   ` Bert Wesarg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100514075913.GA3690@progeny.tock \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=neal@rsss.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).