All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Charles Bailey <charles@hashpling.org>
Cc: git@vger.kernel.org, Hannu Koivisto <azure@iki.fi>,
	Theodore Tso <tytso@mit.edu>
Subject: Re: [PATCH] mergetool: respect autocrlf by using checkout-index
Date: Fri, 23 Jan 2009 09:20:10 -0800	[thread overview]
Message-ID: <7v1vuuvt11.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1232578668-2203-1-git-send-email-charles@hashpling.org> (Charles Bailey's message of "Wed, 21 Jan 2009 22:57:48 +0000")

Charles Bailey <charles@hashpling.org> 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@hashpling.org>

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.

  reply	other threads:[~2009-01-23 17:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21 16:55 git diff, git mergetool and CRLF conversion Hannu Koivisto
2009-01-21 17:23 ` Charles Bailey
2009-01-21 21:03   ` Theodore Tso
2009-01-21 22:57     ` [PATCH] mergetool: respect autocrlf by using checkout-index Charles Bailey
2009-01-23 17:20       ` Junio C Hamano [this message]
2009-01-23 18:18         ` Charles Bailey
2009-01-26 16:15         ` Hannu Koivisto
2009-01-26 16:31           ` Charles Bailey
2009-01-26 21:28             ` Junio C Hamano
2009-01-26 22:08               ` Junio C Hamano
2009-01-26 23:09                 ` Junio C Hamano
2009-01-27 13:58                   ` Hannu Koivisto

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=7v1vuuvt11.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=azure@iki.fi \
    --cc=charles@hashpling.org \
    --cc=git@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.