Re: [PATCH 1/3] backports: update patch Python library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2013-05-06 at 20:03 -0700, Luis R. Rodriguez wrote:

> @@ -627,6 +629,20 @@ class PatchSet(object):
>          return None
>      """
>      for i,p in enumerate(self.items):
> +      if p.type in (HG, GIT):
> +        # TODO: figure out how to deal with /dev/null entries
> +        debug("stripping a/ and b/ prefixes")
> +        if p.source != '/dev/null':
> +          if not p.source.startswith("a/"):
> +            warning("invalid source filename")
> +          else:
> +            p.source = p.source[2:]
> +        if p.target != '/dev/null':
> +          if not p.target.startswith("b/"):
> +            warning("invalid target filename")
> +          else:
> +            p.target = p.target[2:]
> +

Unfortunately, adding this back is problematic.

We assume that all patches need one level stripped, but if a patch is a
git patch (as indicated by having the "diff" and/or (?) "index" lines),
then the patch library will already strip a level. That basically
assumes that users use "-p0" on 'plain' patches, which isn't the case,
we always use -p1.

IOW, this will break dropping git patches (e.g. git
diff/show/format-patch) into the patches directory.

Anatoly, would you be interested in maybe having an option to disable
this stripping? If yes, I can do that, otherwise I'm just going to edit
it out of our copy of your library again :-)

johannes

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux