Re: [PATCH] mergetool: respect autocrlf by using checkout-index

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

 



Charles Bailey <charles@xxxxxxxxxxxxx> writes:

> Previously, git mergetool used cat-file which does not perform git to
> worktree conversion. This changes mergetool to use git checkout-index
> instead which means that the temporary files used for mergetool use the
> correct line endings for the platform.
>
> Signed-off-by: Charles Bailey <charles@xxxxxxxxxxxxx>

Sounds like the right thing to do and from a cursory review it looks Ok to
me.

But I do not use mergetool myself, so an Ack from Ted and a Thanks from
whoever reported the breakage would be encouraging ;-).

> +checkout_staged_file () {
> +    tmpfile=$(expr "$(git checkout-index --temp --stage="$1" "$2")" : '\([^	]*\)	')
> +
> +    if test $? -eq 0 -a -n "$tmpfile" ; then
> +	mv -- "$tmpfile" "$3"

The original redirects into the final destination but this moves.  This
will lose the perm bits of the original and obey the perm bits
checkout-index gives you.  It will also behave differently when the path
is a symlink.  These two differences _may_ well be improvements and/or
bugfixes, but if that is the case please describe them as such.
--
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]

  Powered by Linux