23 Sep 2013, 09:36

Git tip: patch version numbering

If you are collaborating with a project that uses email as a patch exchange method, you will probably need to send many versions of your patches to public mailing lists. To aid in distinguishing the new from the old, we use version numbers on the email subjects; for example

[PATCH v2 0/9] wilink: add device tree support

indicates that these 9 patches are part of the second iteration of the patch series.

Git 1.8.2 added a new option, --reroll-count N, that lets us introduce this number automatically when using format-patch and send-email. This is mostly equivalent to passing --subject="PATCH vN" on older Git versions, except that --reroll-count will also alter the patch filenames.

So, for example

$ git format-patch -2 --reroll-count 3

will generate the following filename

v3-0001-clk-composite-.determine_rate-support.patch

and the subject will be

[PATCH v3 1/2] clk: composite: .determine_rate support