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