Git development
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] "checkout-cache -m" writes unmerged contents for each stage.
Date: Sun, 17 Apr 2005 20:05:16 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0504171957210.7211@ppc970.osdl.org> (raw)
In-Reply-To: <7vk6n0vnbq.fsf@assigned-by-dhcp.cox.net>



On Sun, 17 Apr 2005, Junio C Hamano wrote:
> 
> LT> What do you think? I can whip up a "merge-cache" program like that in five 
> LT> minutes, and it _seems_ like the right interface..
> 
> Yes.  I think that is the right thing to do.  In fact the idea
> is quite similar to what I've been working on, which is a
> rewrite of that perl thing to use "read-tree -m O A B".

I pushed the thing out. It was indeed pretty trivial.

Just as an example, on your merge-test, I can then do

	merge-cache echo -a

and the output is

	 .merge_file_Raanu4 .merge_file_q7ZoLY AA
	 .merge_file_zMXLAW .merge_file_SOugrU AN
	.merge_file_tWf5zS   DD
	.merge_file_YmGzgR   DM
	.merge_file_N1M8oO   DN
	.merge_file_eAC5WL .merge_file_ROg7mM  MD
	.merge_file_G1AWSM .merge_file_LMCruN .merge_file_ucVx7N MM
	  .merge_file_3YxD2O NA
	.merge_file_2SJa6P .merge_file_3V5g6Q  ND
	.merge_file_SIo4nQ   S/DD
	.merge_file_dO8AOP   S/DM
	.merge_file_wOO6iP   S/DN
	.merge_file_RrgnYR .merge_file_KQxqHU  S/MD
	.merge_file_F0sQRX .merge_file_E4DC00 .merge_file_HQkyn2 S/MM
	.merge_file_od0mf4 .merge_file_Xvv035  S/ND
	.merge_file_oEtq17 .merge_file_TwkT5c .merge_file_aqx58h Trivial

(Note that the spaces signify an empty argument in those places, since the
file in question didn't always exist). It executed the "echo" thing 16 
times (once for each object that your script-from-hell had caused a clash 
with).

In all cases you have $1 being "original", $2 being "branch 1", $3 being
"branch 2", and $4 being "name in cache".

ALERT ALERT ALERT! The git "merge object order" is different from the 
"merge" program merge object order. In the above ordering, the original is 
first. But the argument order to the 3-way merge program "merge" is to 
have the original in the middle. Don't ask me why.

Anyway, another example:

	torvalds@ppc970:~/merge-test> merge-cache cat MM
	This is MM from the original tree.			# original
	This is modified MM in the branch A.			# merge1
	This is modified MM in the branch B.			# merge2
	This is modified MM in the branch B.			# current contents

or 

	torvalds@ppc970:~/merge-test> merge-cache cat AA MM
	cat: : No such file or directory
	This is added AA in the branch A.
	This is added AA in the branch B.
	This is added AA in the branch B.
	fatal: merge program failed

where the latter example shows how "merge-cache" will stop trying to merge 
once anything has returned an error (ie "cat" returned an error for the AA 
file, because it didn't exist in the original, and thus "merge-cache" 
didn't even try to merge the MM thing).

		Linus

  reply	other threads:[~2005-04-18  2:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-17 23:03 [PATCH] "checkout-cache -m" writes unmerged contents for each stage Junio C Hamano
2005-04-18  2:05 ` Linus Torvalds
2005-04-18  2:19   ` Junio C Hamano
2005-04-18  3:05     ` Linus Torvalds [this message]
2005-04-18  2:44   ` Junio C Hamano
2005-04-18  2:56     ` Linus Torvalds

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=Pine.LNX.4.58.0504171957210.7211@ppc970.osdl.org \
    --to=torvalds@osdl.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox