git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git-merge-cache / StGIT - gitmergeonefile.py: merging one tree into another rather than two trees into merge base
Date: Fri, 16 Sep 2005 12:59:02 -0700	[thread overview]
Message-ID: <7vvf10hji1.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <tnxslw6d4qt.fsf@arm.com> (Catalin Marinas's message of "Thu, 15 Sep 2005 11:06:50 +0100")

Catalin Marinas <catalin.marinas@gmail.com> writes:

> git-read-tree -m doesn't handle the case when a file is removed from
> one branch and unmodified in the other, which is what happens in your
> test. For each of these removed files, git-merge-cache will call
> gitmergeonefile.py which calls 'git-update-cache --remove'.
>
> An improvement would be to make git-read-tree smarter...

I think this was once discussed but the primary reason for the
behaviour is that Linus wanted to leave as much merge policy
decision to be scriptable without hardcoding it in read-tree.

For example, you would see branch A removing a path while branch
B keeping the path if A renamed it to somewhere else while B
kept it -- a cleverer merge policy than one-path-at-a-time we
currently have _could_ take a hint from the unmerged cache, go
look for the other half of the rename in branch A, and ask the
user if the rename should be honored in the merge result for
example.  If you always do "added or removed in only one head
means take that head", most likely in the above example B would
not have a new path (rename target of A) so you would end up
always taking the file rename.

>> git-diff-tree -r v2.6.13 master |grep ' D'|wc -l
>>
>> gives 189.

A completely different topic:  would it please people if I did this?

    $ git-diff-tree -r --names-and-changes A B
    M	frotz
    R93	rezrov	nitfol
    D	yomin

  parent reply	other threads:[~2005-09-16 19:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-10 18:27 git-merge-cache / StGIT - gitmergeonefile.py: merging one tree into another rather than two trees into merge base Blaisorblade
2005-09-11  8:24 ` Catalin Marinas
2005-09-12 12:59   ` Chuck Lever
2005-09-14 17:46     ` Blaisorblade
2005-09-14 18:16   ` Blaisorblade
2005-09-14 18:19   ` Blaisorblade
2005-09-15 10:06     ` Catalin Marinas
2005-09-16 18:45       ` Blaisorblade
2005-09-16 19:59       ` Junio C Hamano [this message]
2005-09-17  9:31         ` Catalin Marinas
2005-09-19 15:50           ` omitted test scripts? Chuck Lever
2005-09-19 16:19             ` Junio C Hamano
2005-09-19 17:01               ` Daniel Barkalow
2005-09-19 18:54               ` Matthias Urlichs

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=7vvf10hji1.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.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).