All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@gmail.com>
To: Junio C Hamano <junkio@cox.net>
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: Sat, 17 Sep 2005 10:31:57 +0100	[thread overview]
Message-ID: <1126949517.6941.19.camel@localhost.localdomain> (raw)
In-Reply-To: <7vvf10hji1.fsf@assigned-by-dhcp.cox.net>

On Fri, 2005-09-16 at 12:59 -0700, Junio C Hamano wrote:
> 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.

This could be OK for git-read-tree but maybe git-merge-index could have
a --smart option to deal with trivial cases like below (or a separate
tool). Whoever wants to write a more interactive script would not pass
this option.

> 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.

That's what happens with the current merge scripts.

Another option for me would be to try to interface Python with libgit.a
and emulate the git-merge-index behaviour but I've never tried mixing
Python and C before.

> 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

It might help for people using git directly (me as well). StGIT parses
the git-diff-tree output anyway.

-- 
Catalin

  reply	other threads:[~2005-09-17  9:32 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
2005-09-17  9:31         ` Catalin Marinas [this message]
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=1126949517.6941.19.camel@localhost.localdomain \
    --to=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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.