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

Re: [TopGit PATCH 2/2] tg-import.sh: A dump quilt queue importer

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Aug 9, 2008, 07:56 UTC
Message-ID
<36ca99e90808090056n63ce97bduc64a24a524eae2b9@mail.gmail.com>
In-Reply-To
<20080809005736.GR10151@machine.or.cz>
On Sat, Aug 9, 2008 at 02:57, Petr Baudis <pasky@suse.cz> wrote:
Show 13 quoted lines
> On Fri, Aug 08, 2008 at 08:19:48PM +0200, Bert Wesarg wrote:
>> +tg import
>> +~~~~~~~~~
>> +     Import a quilt queue into TopGit. First argument is the series
>> +     file from quilt. Second is the prefix for the topic names
>> +     (i.e. "t/"). All remaining arguments are the dependencies for
>> +     the first patch in the series.
>
> Sensible usage, but I'm not happy with making tg import quilt-only;
> what if we will say want to import to topgit from existing branches,
> or from StGIT or something else? The command name is good, but maybe
> I'd add a required --quilt switch. After all, this is not a command you
> run three times a day by hand.

Your absolutly right, that import should not be quilt specific. It was just what I currently need, so I made it.

Show 7 quoted lines
>
>> + Use '-s' if you want to strip
>> +     common patch suffixes from the patch file name (like .diff and
>> +     .patch).
>
> When *wouldn't* we want to do this? Doesn't it make sense to make this
> the default?
I suggest never ;-)
Show 9 quoted lines
>> +             # add all modified files from patch to index
>> +             # (and prepending it with $root_dir)
>> +             # be stupid, hard coded -p1 --strip=1
>> +             lsdiff --strip=1 "$patchfile" |
>> +                     sed -e "s/^/$root_dir_esc\//" |
>> +                     xargs git add
>
> lsdiff? I don't have this tool. And this won't work with file removals
> properly anyway.
lsdiff comes with the patchutils package.
Show 11 quoted lines
>
> I guess git add -u is too new for us, so you might opt for this snippet
> I've used in git-filter-branch:
>
>        (
>                git diff-index -r --name-only HEAD
>                git ls-files --others
>        ) |
>        git update-index --add --replace --remove --stdin
>
> Or even better, use git apply?
Ohh yeah, that sounds reasonable. Sometimes it an be so easy.
Thanks for the comments and input.
Bert
>
> --
>                                Petr "Pasky" Baudis
Previous: Petr Baudis
Message 4 of 4 in “Factor out the template generation for the .topmsg file”
  1. 1/2 Factor out the template generation for the .topmsg fileBert Wesarg, Aug 8, 2008
  2. 2/2 tg-import.sh: A dump quilt queue importerBert Wesarg, Aug 8, 2008
  3. Petr BaudisAug 9, 2008
  4. Bert WesargAug 9, 2008

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.