git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Yann Dirson <ydirson@altern.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/3] Introduce rename factorization in diffcore.
Date: Fri, 07 Nov 2008 12:19:14 -0800	[thread overview]
Message-ID: <7v3ai3gugt.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20081107193957.GI5158@nan92-1-81-57-214-146.fbx.proxad.net> (Yann Dirson's message of "Fri, 7 Nov 2008 20:39:57 +0100")

Yann Dirson <ydirson@altern.org> writes:

> The direct transposition of the raw output of a dir rename with a
> change would yield something like:
>
> |diff --git a/ppc/ b/foo
> |similarity index 100%
> |rename from ppc/
> |rename to foo/
> |diff --git a/ppc/sha1.h b/foo/sha1.h
> |--- ppc/sha1.h
> |+++ foo/sha1.h
> |...
>
> This would have the usefulness I'm looking for, in that the content
> modifications would not be "hidden" among a whole lot af individual
> file rename hunks.

I am afraid that this is totally unacceptable, as you yourself mentioned,
the end result is unapplicable with any existing tool and would confuse
viewers like gitk and gitweb.

I think it would be a much better approach to emit a hint that talks about
directory rename in a format that does not fool usual "patch" application
tools.  E.g.

|directory moved with similarity index 82%
|rename from ppc
|rename from foo
|diff --git a/ppc/sha1.h b/foo/sha1.h
|similarity index 85%
|rename from ppc/sha1.h
|rename to foo/sha1.h
|index  9b34f76..8fce4b7 100644
|--- ppc/sha1.h
|+++ foo/sha1.h
|@@ ...

IOW, do not add anything that begins with "diff --git" if it is not a
patch.

  reply	other threads:[~2008-11-07 20:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-01 22:03 [PATCH v3 0/3] Detection of directory renames Yann Dirson
2008-11-01 22:03 ` [PATCH 1/3] Fix error in diff_filepair::status documentation Yann Dirson
2008-11-02  6:31   ` Junio C Hamano
2008-11-01 22:03 ` [PATCH 2/3] Introduce rename factorization in diffcore Yann Dirson
2008-11-07  1:10   ` Junio C Hamano
2008-11-07 19:39     ` Yann Dirson
2008-11-07 20:19       ` Junio C Hamano [this message]
2008-11-07 20:39         ` Yann Dirson
2008-11-07 21:11           ` Junio C Hamano
2008-11-07 22:12             ` Yann Dirson
2008-11-07 23:43               ` Junio C Hamano
2008-11-08  0:29                 ` Yann Dirson
2008-11-08  0:47                   ` Junio C Hamano
2008-11-08  0:50                     ` Yann Dirson
2008-11-01 22:03 ` [PATCH 3/3] Add testcases for the --factorize-renames diffcore flag Yann Dirson

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=7v3ai3gugt.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ydirson@altern.org \
    /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).