Subject: Re: [StGit PATCH] add option to import series directly from a tar archive

From: Clark Williams <[email-masked]>
Date: Fri, 12 Sep 2008 07:57:47 -0500

Samuel Tardieu wrote:
>>>>>> "Clark" == Clark Williams <[email-masked]> writes:
> 
> Clark> [...] is to see if I can ease StGit's patch
> Clark> import rules a bit, since quilt accepts pretty much anything as
> Clark> long as there's a diff in there somewhere. I bomb out regularly
> Clark> importing the -rt series using StGit, because some people don't
> Clark> put complete email addresses in their patches.
> 
> Two things that would be great would be:
> 
>   - to be able to import patches with "-p0" (people not using git
>     often sends such patches)

I'm not sure how easy this is going to be. It looks like the patch is applied with
'git --apply' from the file stgit/git.py:apply_patch(). The default '-p' value is 1,
so we'd have to figure out how to pass the 0 along and then get it into the
apply_patch() function.

> 
>   - to be able to find where the patch should be applied; I sometimes
>     receive patches for GCC directory "gcc/ada/", diffed from there,
>     and if StGit could see that the patch only makes sense there and
>     not at the top-level it would be great as well
> 

Zowie, I thought I only had to worry about folks sending patches with incomplete
information. So you get patches to the ada compiler that are rooted in gcc/ada (e.g.
patch in tarball says "./ChangeLog", instead of gcc/ada/ChangeLog) rather than at a
top level? Only way I could see to deal with that would be to try and pass in the
appropriate prefix from the command line.

My current plans are to clean up the first cut at the tarfile logic, then write a
test to keep Karl happy, then try to come up with a way to deal with importing
patches that don't have complete email addresses, no descriptions, etc. Once I get
through that, I'll see if we can deal with weirdly rooted patch series.

Clark