<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Jonas,</p>
    <p>I've been trying to follow your advice. Although I moved forward,
      I still have some questions.<br>
    </p>
    <p>I've managed to produce a patch with <i>quilt</i> for the 2001
      patch. The issue seems to be that quilt ignores empty files.</p>
    <p>The attached patch just adds __init__.py with a comment. But I
      left the changelog or bumping versions, not sure if they should be
      included.</p>
    <p>My difficulty comes when trying to build the package. I have
      tried both `gbp buildpackage` (promising, no result, complains
      about not pushed commits, and after pushing to a clone, about
      untracked files, and finally about not having Jonas's secret key)
      and also tried `sudo debian/rules binary` which produces a package
      without patches.</p>
    <p>Thanks for your guidance. <br>
    </p>
    <p>Upstream also has a fix for #861052 which actually turns out to
      be a bug in Browse too, James, do you think we should add this
      patch to Stretch?</p>
    <p>Regards,</p>
    <p>Sebastian<br>
    </p>
    <div class="moz-cite-prefix">El 21/04/17 a las 02:22, Jonas
      Smedegaard escribió:<br>
    </div>
    <blockquote
      cite="mid:149275934693.7651.2269297138784951773@auryn.jones.dk"
      type="cite">
      <pre wrap="">Quoting Sebastian Silva (2017-04-21 07:08:23)
</pre>
      <blockquote type="cite">
        <pre wrap="">It's been a couple of years since I last tried to help with packages.

Here's a patch to the packaging of Browse. However I'm a little rusty on
pristine-tar etc.

Could you please guide me? Perhaps there's a better way.
</pre>
      </blockquote>
      <pre wrap="">
Apart from James' excellent comments, a more general note:

It seems you let dpkg auto-generate a patch for you.

Not sure if better or I am just old-fashioned, but whenever dpkg 
auto-generates a patch for me, I take it as an error: Throw away that 
patch, roll back to a stable state in git, and try again.

I use quilt to manage patches - here's how to add a file to an existing 
patch using quilt:

1extend) apply the old patch:

  quilt push

(if there were multiple patches in the stack, keep pushing unitl the 
patch you want to edit is the one applied (no no other on top of that).

2) register with git the new (i.e. not yet existing) file):

  quilt add path/to/new/file

3) edit the file:

  [here: simply copy the new file into place]

4) update the patch:

  quilt refresh

5) unapply the patch (and any other patches below that in the stack):

  quilt pop -a


You should now have a clean git, except the patch file below 
/debian/patches is changed.

If you instead want to add a new patch at the end of the patch stack, 
replace 1-extend) with this:

1append)

  quilt push -a
  quilt new name-of-new-patch.patch

End result should then be a clean git, except the aded patch and a 
one-line change to debian/patches/series.


By default, patches are created with timestamps and other embedded 
hints.
</pre>
    </blockquote>
    The above commands only work after the following...<br>
    <blockquote
      cite="mid:149275934693.7651.2269297138784951773@auryn.jones.dk"
      type="cite">
      <pre wrap="">
To avoid that (and a few other tricks), I have the following in the file 
~/.quiltrc:

d=. ; while [ ! -d $d/debian -a `readlink -e $d` != / ]; do d=$d/..; done
if [ -d $d/debian ] && [ -z $QUILT_PATCHES ]; then
  # if in Debian packaging tree with unset $QUILT_PATCHES
  QUILT_PATCHES="debian/patches"
  QUILT_PATCH_OPTS="--reject-format=unified"
  QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
  QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
  QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
  if ! [ -d $d/debian/patches ]; then mkdir $d/debian/patches; fi
fi
</pre>
    </blockquote>
    I've added this incantation to my dotfiles but it's very confusing.<br>
    <blockquote
      cite="mid:149275934693.7651.2269297138784951773@auryn.jones.dk"
      type="cite">
      <pre wrap="">

To tidy existing patches, use "quilt refresh" after they are applied.

What I do to tidy a full patch series is repeat this until it fails:

  quilt push && quilt refresh


Hope that helps,

 - Jonas

</pre>
    </blockquote>
    <br>
  </body>
</html>