[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
"git format-patch" question
From: |
Assaf Gordon |
Subject: |
"git format-patch" question |
Date: |
Tue, 11 Dec 2012 11:17:20 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120510 Icedove/10.0.4 |
Hello,
(picking up from a different thread)
Pádraig Brady wrote, On 12/06/2012 06:59 PM:
> Generally it's best to get git to send email
> or send around formats that git can apply directly,
> which includes commit messages and references new files etc.
> The handiest way to do that is:
>
> git format-patch --stdout -1 | gzip > numfmt.5.patch.gz
While working on my development branch, I commit small, specific changes, as so:
[PATCH 1/6] numfmt: a new command to format numbers
[PATCH 2/6] numfmt: change SI/IEC parameters to lowercase.
[PATCH 3/6] numfmt: separate debug/devdebug options.
[PATCH 4/6] numfmt: fix segfault when no numbers are found.
[PATCH 5/6] numfmt: improve --field, add more tests.
[PATCH 6/6] numfmt: add --header option.
Each commit can be just few lines.
When I send a patch the the mailing list, I want to send one 'nice' 'clean'
patch with my changes, compared to the master branch.
When I use the following command:
git diff -p --stat master..HEAD > my.patch
And all the changes (multiple commits) I made on my branch compared to master
are represented as one coherent change in "my.patch" - but this is not
convenient for you to apply.
However, when I use
git format-patch --stdout -1 > my.patch
Only the last commit appears.
The alternative:
git format-patch --stdout master..HEAD > my.patch
Generates a file which will cause multiple commits when imported with "git am" .
When is the recommended way to generate a clean patch which will consolidate
all my small commits into one?
Or is there another way?
Thanks,
-gordon
- "git format-patch" question,
Assaf Gordon <=