threads / discuss / 757

Problem with cg-merge

Subject: Problem with cg-merge

## tl;dr

10 messages between May 29, 2005 and May 29, 2005.

replies: 9people: 4as markdown or json

Marcel Holtmann· May 29, 2005, 15:04 UTC · lore
Hi Petr,

I saw that earlier, but I don't have any idea what's wrong here. If I do a simple cg-update, I see something like this:

Tree change: cf1f29d97210d0594dcf5b2a734bdb714de6bf24:89a14a5bd2c880095d5c618a102319bb3dc03da9 :100755 100755 ceda2c50fc2c2941daa34a57722df251bf892c38 fea239b99d351502d1acb098abd725557f0af202 M cg-diff :100755 100755 cc0c17beef75db41da3ad4ef8983bd7e222ac739 5f0bff77eb2110d52892793e5bef104acde7be32 M cg-help

Applying changes...
Fast-forwarding cf1f29d97210d0594dcf5b2a734bdb714de6bf24 -> 89a14a5bd2c880095d5c618a102319bb3dc03da9
        on top of cf1f29d97210d0594dcf5b2a734bdb714de6bf24...
patching file cg-diff
patching file cg-help
cg-diff: needs update
cg-help: needs update

This is a little bit odd, because if I call "git-diff-cache HEAD" after it, I will see that cg-diff and cg-help are modified. After calling cg-cancel everything looks fine again.

Regards
Marcel
Sean· May 29, 2005, 16:30 UTC · re: Marcel Holtmann · lore

Re: Problem with cg-merge

On Sun, May 29, 2005 11:04 am, Marcel Holtmann said:
Show 24 quoted lines
> Hi Petr,
>
> I saw that earlier, but I don't have any idea what's wrong here. If I do
> a simple cg-update, I see something like this:
>
> Tree change:
> cf1f29d97210d0594dcf5b2a734bdb714de6bf24:89a14a5bd2c880095d5c618a102319bb3dc03da9
> :100755 100755 ceda2c50fc2c2941daa34a57722df251bf892c38
> fea239b99d351502d1acb098abd725557f0af202 M      cg-diff
> :100755 100755 cc0c17beef75db41da3ad4ef8983bd7e222ac739
> 5f0bff77eb2110d52892793e5bef104acde7be32 M      cg-help
>
> Applying changes...
> Fast-forwarding cf1f29d97210d0594dcf5b2a734bdb714de6bf24 ->
> 89a14a5bd2c880095d5c618a102319bb3dc03da9
>         on top of cf1f29d97210d0594dcf5b2a734bdb714de6bf24...
> patching file cg-diff
> patching file cg-help
> cg-diff: needs update
> cg-help: needs update
>
> This is a little bit odd, because if I call "git-diff-cache HEAD" after
> it, I will see that cg-diff and cg-help are modified. After calling
> cg-cancel everything looks fine again.
Marcel,

Any chance you've installed a copy of git core in addition to your original install of Cogito? That looks like a problem i saw when using a newer git installed overtop of Cogito.

Sean
Marcel Holtmann· May 29, 2005, 18:17 UTC · re: Sean · lore

Re: Problem with cg-merge

Hi Sean,
Show 26 quoted lines
> > I saw that earlier, but I don't have any idea what's wrong here. If I do
> > a simple cg-update, I see something like this:
> >
> > Tree change:
> > cf1f29d97210d0594dcf5b2a734bdb714de6bf24:89a14a5bd2c880095d5c618a102319bb3dc03da9
> > :100755 100755 ceda2c50fc2c2941daa34a57722df251bf892c38
> > fea239b99d351502d1acb098abd725557f0af202 M      cg-diff
> > :100755 100755 cc0c17beef75db41da3ad4ef8983bd7e222ac739
> > 5f0bff77eb2110d52892793e5bef104acde7be32 M      cg-help
> >
> > Applying changes...
> > Fast-forwarding cf1f29d97210d0594dcf5b2a734bdb714de6bf24 ->
> > 89a14a5bd2c880095d5c618a102319bb3dc03da9
> >         on top of cf1f29d97210d0594dcf5b2a734bdb714de6bf24...
> > patching file cg-diff
> > patching file cg-help
> > cg-diff: needs update
> > cg-help: needs update
> >
> > This is a little bit odd, because if I call "git-diff-cache HEAD" after
> > it, I will see that cg-diff and cg-help are modified. After calling
> > cg-cancel everything looks fine again.
> 
> Any chance you've installed a copy of git core in addition to your
> original install of Cogito?   That looks like a problem i saw when using a
> newer git installed overtop of Cogito.
no, I don't.
Regards
Marcel
Jonas Fonseca· May 29, 2005, 18:07 UTC · re: Marcel Holtmann · lore

Re: Problem with cg-merge

Marcel Holtmann <marcel@holtmann.org> wrote Sun, May 29, 2005:
Show 20 quoted lines
> Hi Petr,
> 
> I saw that earlier, but I don't have any idea what's wrong here. If I do
> a simple cg-update, I see something like this:
> 
> Tree change: cf1f29d97210d0594dcf5b2a734bdb714de6bf24:89a14a5bd2c880095d5c618a102319bb3dc03da9
> :100755 100755 ceda2c50fc2c2941daa34a57722df251bf892c38 fea239b99d351502d1acb098abd725557f0af202 M      cg-diff
> :100755 100755 cc0c17beef75db41da3ad4ef8983bd7e222ac739 5f0bff77eb2110d52892793e5bef104acde7be32 M      cg-help
> 
> Applying changes...
> Fast-forwarding cf1f29d97210d0594dcf5b2a734bdb714de6bf24 -> 89a14a5bd2c880095d5c618a102319bb3dc03da9
>         on top of cf1f29d97210d0594dcf5b2a734bdb714de6bf24...
> patching file cg-diff
> patching file cg-help
> cg-diff: needs update
> cg-help: needs update
> 
> This is a little bit odd, because if I call "git-diff-cache HEAD" after
> it, I will see that cg-diff and cg-help are modified. After calling
> cg-cancel everything looks fine again.
The following change fixes cg-update for me. This is in tree_timewarp().

--- 0ca4ae56fa7bbd8d10e2c2791e389bc19977e460/cg-Xlib (mode:100755) +++ uncommitted/cg-Xlib (mode:100755)

@@ -66,7 +66,7 @@
 		# XXX: This may be suboptimal, but it is also non-trivial to keep
 		# the adds/removes properly.  So this is just a quick hack to get it
 		# working without much fuss.
-		cg-diff -r $branch >$patchfile
+		cg-diff >$patchfile
 	fi
 
 	git-read-tree -m "$branch" || die "$branch: bad commit"
-- 
Jonas Fonseca
Marcel Holtmann· May 29, 2005, 18:17 UTC · re: Jonas Fonseca · lore

Re: Problem with cg-merge

Hi Jonas,
Show 32 quoted lines
> > I saw that earlier, but I don't have any idea what's wrong here. If I do
> > a simple cg-update, I see something like this:
> > 
> > Tree change: cf1f29d97210d0594dcf5b2a734bdb714de6bf24:89a14a5bd2c880095d5c618a102319bb3dc03da9
> > :100755 100755 ceda2c50fc2c2941daa34a57722df251bf892c38 fea239b99d351502d1acb098abd725557f0af202 M      cg-diff
> > :100755 100755 cc0c17beef75db41da3ad4ef8983bd7e222ac739 5f0bff77eb2110d52892793e5bef104acde7be32 M      cg-help
> > 
> > Applying changes...
> > Fast-forwarding cf1f29d97210d0594dcf5b2a734bdb714de6bf24 -> 89a14a5bd2c880095d5c618a102319bb3dc03da9
> >         on top of cf1f29d97210d0594dcf5b2a734bdb714de6bf24...
> > patching file cg-diff
> > patching file cg-help
> > cg-diff: needs update
> > cg-help: needs update
> > 
> > This is a little bit odd, because if I call "git-diff-cache HEAD" after
> > it, I will see that cg-diff and cg-help are modified. After calling
> > cg-cancel everything looks fine again.
> 
> The following change fixes cg-update for me. This is in tree_timewarp().
> 
> --- 0ca4ae56fa7bbd8d10e2c2791e389bc19977e460/cg-Xlib  (mode:100755)
> +++ uncommitted/cg-Xlib  (mode:100755)
> @@ -66,7 +66,7 @@
>  		# XXX: This may be suboptimal, but it is also non-trivial to keep
>  		# the adds/removes properly.  So this is just a quick hack to get it
>  		# working without much fuss.
> -		cg-diff -r $branch >$patchfile
> +		cg-diff >$patchfile
>  	fi
>  
>  	git-read-tree -m "$branch" || die "$branch: bad commit"
this looks better now. Petr, please apply this patch.
Regards
Marcel
Petr Baudis· May 29, 2005, 18:48 UTC · re: Marcel Holtmann · lore

Re: Problem with cg-merge

Dear diary, on Sun, May 29, 2005 at 08:17:30PM CEST, I got a letter where Marcel Holtmann <marcel@holtmann.org> told me that...

Show 36 quoted lines
> Hi Jonas,
> 
> > > I saw that earlier, but I don't have any idea what's wrong here. If I do
> > > a simple cg-update, I see something like this:
> > > 
> > > Tree change: cf1f29d97210d0594dcf5b2a734bdb714de6bf24:89a14a5bd2c880095d5c618a102319bb3dc03da9
> > > :100755 100755 ceda2c50fc2c2941daa34a57722df251bf892c38 fea239b99d351502d1acb098abd725557f0af202 M      cg-diff
> > > :100755 100755 cc0c17beef75db41da3ad4ef8983bd7e222ac739 5f0bff77eb2110d52892793e5bef104acde7be32 M      cg-help
> > > 
> > > Applying changes...
> > > Fast-forwarding cf1f29d97210d0594dcf5b2a734bdb714de6bf24 -> 89a14a5bd2c880095d5c618a102319bb3dc03da9
> > >         on top of cf1f29d97210d0594dcf5b2a734bdb714de6bf24...
> > > patching file cg-diff
> > > patching file cg-help
> > > cg-diff: needs update
> > > cg-help: needs update
> > > 
> > > This is a little bit odd, because if I call "git-diff-cache HEAD" after
> > > it, I will see that cg-diff and cg-help are modified. After calling
> > > cg-cancel everything looks fine again.
> > 
> > The following change fixes cg-update for me. This is in tree_timewarp().
> > 
> > --- 0ca4ae56fa7bbd8d10e2c2791e389bc19977e460/cg-Xlib  (mode:100755)
> > +++ uncommitted/cg-Xlib  (mode:100755)
> > @@ -66,7 +66,7 @@
> >  		# XXX: This may be suboptimal, but it is also non-trivial to keep
> >  		# the adds/removes properly.  So this is just a quick hack to get it
> >  		# working without much fuss.
> > -		cg-diff -r $branch >$patchfile
> > +		cg-diff >$patchfile
> >  	fi
> >  
> >  	git-read-tree -m "$branch" || die "$branch: bad commit"
> 
> this looks better now. Petr, please apply this patch.

Bah. Well if your imaginary friend in your head told you this is obviously just a no-go workaround, (s)he was right for once. You just broke cg-admin-uncommit with this one, the real fix is to tell tree_timewarp to rollback the tree (or rather rollforth here ;-). This way the right branch of this if will be invoked.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Marcel Holtmann· May 29, 2005, 19:48 UTC · re: Petr Baudis · lore

Re: Problem with cg-merge

Hi Petr,
Show 40 quoted lines
> > > > I saw that earlier, but I don't have any idea what's wrong here. If I do
> > > > a simple cg-update, I see something like this:
> > > > 
> > > > Tree change: cf1f29d97210d0594dcf5b2a734bdb714de6bf24:89a14a5bd2c880095d5c618a102319bb3dc03da9
> > > > :100755 100755 ceda2c50fc2c2941daa34a57722df251bf892c38 fea239b99d351502d1acb098abd725557f0af202 M      cg-diff
> > > > :100755 100755 cc0c17beef75db41da3ad4ef8983bd7e222ac739 5f0bff77eb2110d52892793e5bef104acde7be32 M      cg-help
> > > > 
> > > > Applying changes...
> > > > Fast-forwarding cf1f29d97210d0594dcf5b2a734bdb714de6bf24 -> 89a14a5bd2c880095d5c618a102319bb3dc03da9
> > > >         on top of cf1f29d97210d0594dcf5b2a734bdb714de6bf24...
> > > > patching file cg-diff
> > > > patching file cg-help
> > > > cg-diff: needs update
> > > > cg-help: needs update
> > > > 
> > > > This is a little bit odd, because if I call "git-diff-cache HEAD" after
> > > > it, I will see that cg-diff and cg-help are modified. After calling
> > > > cg-cancel everything looks fine again.
> > > 
> > > The following change fixes cg-update for me. This is in tree_timewarp().
> > > 
> > > --- 0ca4ae56fa7bbd8d10e2c2791e389bc19977e460/cg-Xlib  (mode:100755)
> > > +++ uncommitted/cg-Xlib  (mode:100755)
> > > @@ -66,7 +66,7 @@
> > >  		# XXX: This may be suboptimal, but it is also non-trivial to keep
> > >  		# the adds/removes properly.  So this is just a quick hack to get it
> > >  		# working without much fuss.
> > > -		cg-diff -r $branch >$patchfile
> > > +		cg-diff >$patchfile
> > >  	fi
> > >  
> > >  	git-read-tree -m "$branch" || die "$branch: bad commit"
> > 
> > this looks better now. Petr, please apply this patch.
> 
> Bah. Well if your imaginary friend in your head told you this is
> obviously just a no-go workaround, (s)he was right for once. You just
> broke cg-admin-uncommit with this one, the real fix is to tell
> tree_timewarp to rollback the tree (or rather rollforth here ;-). This
> way the right branch of this if will be invoked.

I had no idea if the patch was correct or not, but it was working for me. I also tested your fix for it and it works for me and I am happy again.

Regards
Marcel
Jonas Fonseca· May 29, 2005, 21:15 UTC · re: Petr Baudis · lore

Re: Problem with cg-merge

Petr Baudis <pasky@ucw.cz> wrote Sun, May 29, 2005:
Show 21 quoted lines
> Dear diary, on Sun, May 29, 2005 at 08:17:30PM CEST, I got a letter
> where Marcel Holtmann <marcel@holtmann.org> told me that...
> > > --- 0ca4ae56fa7bbd8d10e2c2791e389bc19977e460/cg-Xlib  (mode:100755)
> > > +++ uncommitted/cg-Xlib  (mode:100755)
> > > @@ -66,7 +66,7 @@
> > >  		# XXX: This may be suboptimal, but it is also non-trivial to keep
> > >  		# the adds/removes properly.  So this is just a quick hack to get it
> > >  		# working without much fuss.
> > > -		cg-diff -r $branch >$patchfile
> > > +		cg-diff >$patchfile
> > >  	fi
> > >  
> > >  	git-read-tree -m "$branch" || die "$branch: bad commit"
> > 
> > this looks better now. Petr, please apply this patch.
> 
> Bah. Well if your imaginary friend in your head told you this is
> obviously just a no-go workaround, (s)he was right for once. You just
> broke cg-admin-uncommit with this one, the real fix is to tell
> tree_timewarp to rollback the tree (or rather rollforth here ;-). This
> way the right branch of this if will be invoked.
Ok, I should have mentioned it was an ugly workaround.

There is another problem I've noticed in the work on the cogito manpages. To make it easier to update the ``external'' patch I maintain I have added the files Documentation/make-cg-asciidoc and Documentation/make-cogito-asciidoc but not actually committed them. That way cg-diff will include them (diffed against /dev/null) which I like very much. However, when I cg-update from my local cogito origin cg-merge will fast-forward using cg-diff which results in rejects when patching the local changes due to the files already existing.

One possibility would be to revert all local changes with the patch generated by cg-diff since most of them will be overwritten anyway. This would remove uncommitted added files but it would probably require use of the GIT metadata to get the fast-forwarding right with modes intact.

-- 
Jonas Fonseca
Petr Baudis· May 29, 2005, 22:40 UTC · re: Jonas Fonseca · lore

Re: Problem with cg-merge

Dear diary, on Sun, May 29, 2005 at 11:15:24PM CEST, I got a letter where Jonas Fonseca <fonseca@diku.dk> told me that...

Show 14 quoted lines
> There is another problem I've noticed in the work on the cogito
> manpages. To make it easier to update the ``external'' patch I maintain
> I have added the files Documentation/make-cg-asciidoc and
> Documentation/make-cogito-asciidoc but not actually committed them.
> That way cg-diff will include them (diffed against /dev/null) which I
> like very much. However, when I cg-update from my local cogito origin
> cg-merge will fast-forward using cg-diff which results in rejects when
> patching the local changes due to the files already existing.
> 
> One possibility would be to revert all local changes with the patch
> generated by cg-diff since most of them will be overwritten anyway.
> This would remove uncommitted added files but it would probably require
> use of the GIT metadata to get the fast-forwarding right with modes
> intact.

I'm confused. Are you suggesting that we just throw away any local changes when updating? That sounds horrible - it's something the user has full right not to expect and I'd be very careful about it.

In the longer term we shouldn't muck with diff | patch but instead do a three-way merge on the local changes too.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Jonas Fonseca· May 29, 2005, 22:58 UTC · re: Petr Baudis · lore

Re: Problem with cg-merge

Petr Baudis <pasky@ucw.cz> wrote Mon, May 30, 2005:
Show 20 quoted lines
> Dear diary, on Sun, May 29, 2005 at 11:15:24PM CEST, I got a letter
> where Jonas Fonseca <fonseca@diku.dk> told me that...
> > There is another problem I've noticed in the work on the cogito
> > manpages. To make it easier to update the ``external'' patch I maintain
> > I have added the files Documentation/make-cg-asciidoc and
> > Documentation/make-cogito-asciidoc but not actually committed them.
> > That way cg-diff will include them (diffed against /dev/null) which I
> > like very much. However, when I cg-update from my local cogito origin
> > cg-merge will fast-forward using cg-diff which results in rejects when
> > patching the local changes due to the files already existing.
> > 
> > One possibility would be to revert all local changes with the patch
> > generated by cg-diff since most of them will be overwritten anyway.
> > This would remove uncommitted added files but it would probably require
> > use of the GIT metadata to get the fast-forwarding right with modes
> > intact.
> 
> I'm confused. Are you suggesting that we just throw away any local
> changes when updating? That sounds horrible - it's something the user
> has full right not to expect and I'd be very careful about it.

Forget what I suggested. The current way to cg-diff then update the tree and apply the local changes on top of that does handled locally added but uncommited files.

> In the longer term we shouldn't muck with diff | patch but instead do a
> three-way merge on the local changes too.
Yes, that sounds nice.
-- 
Jonas Fonseca

← back to recent threads