git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add "list" and "rm" sub commands to tg-depend

From
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date
Apr 9, 2009, 20:15 UTC
Message-ID
<20090409201515.GA4218@pengutronix.de>
In-Reply-To
<36ca99e90904091101l6dd1685y5be70dd77bf52b57@mail.gmail.com>
Hello,
On Thu, Apr 09, 2009 at 08:01:04PM +0200, Bert Wesarg wrote:
Show 30 quoted lines
> 2009/4/9 Ira Weiny <weiny2@llnl.gov>:
> > On Thu, 9 Apr 2009 14:43:37 +0200
> > Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> >> You might want to check
> >>
> >>       http:// thread.gmane.org/gmane.comp.version-control.git/114581
> >
> > Ah this brings up more issues I had not thought about...  :-(  But perhaps
> > Bert's work could be used to help implement "rm".  Thoughts?
> No, it wont help. Because the base and tip of the topic should not
> changed in respect to the old state (expect for .topdeps of course).
> 
> If you really want to remove a dependency, you need to revert a merge
> of this dep from the topic base. which is not possible today, or maybe
> I have just an idea for this:
> 
>   'topic': the topic
>   'base':  the base of the topic, i.e. a merge from all dependent
> topics dep0, ..., depN
> 
> say you want to remove dep0
> 
>   1) merge all deps dep1, ..,depN into 'new-base'
> 
>   2) merge 'new-base' into base with the merge driver 'theirs', that
> would overwrite all changes from dep0 in the 'base'
> 
>   3) update 'topic' to the updated 'base'
> 
> Any thoughts from someone who knows more than me?
Some time ago I thought about a similar issue:

I based a branch on top of the Linux tree of the ARM maintainer (in the following called "rmk") and decided later to base it on top of Linus' tree. So I did ~:

	git checkout refs/top-bases/$branch
	git merge -s theirs linus/master
	git checkout $branch
	sed -i s,rmk,linus, .topdeps
	git add -f .topdeps
	git commit -m $commitmsg
	tg update

When I thought about it with pencil and paper back then, I saw a problem with that approach. Now I invested some time now to verify it really exists: In fact I reverted the changes in the rmk/master branch. Consider Linus pulls from rmk and I update my topgit branch. Guess what happens? Linus' pull + my revert yield Linus' tree without rmk's changes.

Here is my recipe:
	# prepare linus/master
	git init
	echo 'VERSION=2.6.28' > Makefile
	git add Makefile; git commit -m 'v2.6.28'
	git branch -m master linus/master
	# prepare rmk/master
	git checkout -b rmk/master
	echo 'support for some machine' > arm.c
	git add arm.c; git commit -m 'support for some machine'
	# new topgit branch
	tg create t/test
	echo change > lib.c
	git add lib.c; git commit -m 'tralala'
	# Linus goes on ...
	git checkout linus/master
	echo 'VERSION=2.6.29-rc1' > Makefile
	git add Makefile; git commit -m 'v2.6.29-rc1'
	# "rebase" test branch on linus/master
	git checkout refs/top-bases/t/test
	git symbolic-ref HEAD refs/top-bases/t/test
	git merge --no-commit linus/master
	git read-tree linus/master
	git commit
	rm arm.c
	git checkout t/test
	sed -i s/rmk/linus/ .topdeps
	git add .topdeps; git commit -m 'change dep: rmk/master -> linus/master'
	tg update
	# Linus pulls from rmk
	git checkout linus/master
	git merge rmk/master
	# update test to linus+rmk
	git checkout t/test
	tg update
	# inspect:
	git diff linus/master refs/top-bases/t/test

The last command shows that refs/top-bases/t/test doesn't have arm.c :-/

I'm sure the dependency deletion has exactly the same problem.

Best regards Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
Previous: Bert WesargNext: Bert Wesarg
Message 4 of 7 in “Re: [PATCH] Add "list" and "rm" sub commands to tg-depend”
  1. Bert WesargApr 9, 2009
  2. Ira WeinyApr 9, 2009
  3. Bert WesargApr 9, 2009
  4. Uwe Kleine-KönigApr 9, 2009
  5. Bert WesargApr 11, 2009
  6. Uwe Kleine-KönigApr 11, 2009
  7. Bert WesargApr 11, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.