git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bert Wesarg <bert.wesarg@googlemail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Neal Kreitzinger <neal@rsss.com>, git@vger.kernel.org
Subject: Re: interactive rebase editor pathname variable
Date: Fri, 14 May 2010 14:49:48 +0200	[thread overview]
Message-ID: <AANLkTimb8fCQoX31GkPqsjtnKgi6TLlUPToodZcZocHJ@mail.gmail.com> (raw)
In-Reply-To: <20100514075913.GA3690@progeny.tock>

On Fri, May 14, 2010 at 09:59, Jonathan Nieder <jrnieder@gmail.com> wrote:
> 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\"' -"
>

Barely tested:

someditor "$PWD/${1/#$PWD\//}"

Bert

> Hope that helps,
> Jonathan
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

      reply	other threads:[~2010-05-14 12:49 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
2010-05-14 12:49   ` Bert Wesarg [this message]

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=AANLkTimb8fCQoX31GkPqsjtnKgi6TLlUPToodZcZocHJ@mail.gmail.com \
    --to=bert.wesarg@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --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).