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

Re: Import existing (old) topic branches in topgit

From
MKmartin f krafft <madduck@madduck.net>
Date
Sep 15, 2010, 04:55 UTC
Message-ID
<20100915045509.GA16770@fishbowl.rw.madduck.net>
In-Reply-To
<AANLkTima2NsEWuT85oFZGpfCQrsrqy5KsQSOez3B9i-7@mail.gmail.com>
also sprach Guilhem Bonnefille <guilhem.bonnefille@gmail.com> [2010.09.14.2244 +0200]:
> But as I'm new to this tool, I don't know what's the best way to
> import existing branches in topgit.

There is tg-import, but it looks like it rewrites the history, which you might not want.

This should be trivially possible, and it would be nice if TopGit could help you, but for now you will have to do this manually. The following is an example for the simple case when branch foo depends on master, and you want to convert foo:

1. git checkout foo    # the topic branch
2. git update-ref refs/top-bases/foo $(git merge-base master HEAD)
3. echo master > .topdeps
4. git format-patch --stdout -s HEAD^ | sed -e 1d -e '/---/,$d' -e '/^Date:/d' > .topmsg
5. git add .top(deps|msg)
6. git commit -sm'convrting branch to topgit format'
7. tg summary
Now: will you write a new tg-import or tg-convert? ;)
Cheers,
-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
a: no.
q: should i include quotations after my reply?
 
spamtraps: madduck.bogus@madduck.net
Previous: Guilhem Bonnefille
Message 2 of 2 in “Import existing (old) topic branches in topgit”
  1. Guilhem BonnefilleSep 14, 2010
  2. martin f krafftSep 15, 2010

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.