Re: interactive rebase editor pathname variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 14, 2010 at 09:59, Jonathan Nieder <jrnieder@xxxxxxxxx> 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@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]