Re: [PATCH 00/12] Towards a better merge resolution support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Abhijit Menon-Sen wrote:
> At 2008-09-01 11:44:12 +0200, raa.lkml@xxxxxxxxx wrote:
> >
> > IOW, copy the commit resolution from some other merge commit. Maybe
> > can be a way to use rerere mechanism with that?
> 
> That's what I'm trying to implement on Dscho's suggestion. I'm still
> just trying to understand the code, so any suggestions about how to
> do this are very welcome.

Random idea: you could use a script that just replays the merges
present in history and lets rerere record them.  Like so:

-- 8< --
#!/bin/sh

. "$(git --exec-path)/git-sh-setup"

require_work_tree
git update-index --refresh || die "can't run with dirty index"

git rev-list --parents "$@" |
grep '.* .* .*' |
while read merge firstparent otherparents
do
	git checkout $firstparent >/dev/null 2>/dev/null
	git merge $otherparents >/dev/null
	if test -z "$(git ls-files -u)"; then
		echo -n 'no conflicts: '
		git --no-pager log -1 --pretty=oneline --abbrev-commit $merge
		continue
	fi
	git rerere
	git ls-files -t | grep ^M | cut -c 3- | xargs git checkout $merge --
	git rerere
	git reset --hard >/dev/null 2>/dev/null
	echo -n 'recorded:     '
	git --no-pager log -1 --pretty=oneline --abbrev-commit $merge
done
-- >8 --

The intended usage is like

  ./rerereimport.sh v1.6.0..origin/next

to import all resolutions in the specified range.  Granted, it's
probably not as good and definitely not as fast as an automatic
feature integrated with the merge machinery.

- Thomas

-- 
Thomas Rast
trast@xxxxxxxxxxxxxxx


Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux