Re: [PATCH v2 0/2] support -m"" combined with commit --fixup
On Fri, Dec 22 2017, Eric Sunshine jotted: > On Fri, Dec 22, 2017 at 11:00 AM, Ævar Arnfjörð Bjarmason > wrote: >> Here's a hopefully ready to apply v2 incorporating feedback from Eric >> (thanks!). A tbdiff with v1 follows below. >> >> Ævar Arnfjörð Bjarmason (2): >> commit doc: document that -c, -C, -F and --fixup with -m error >> commit: add support for --fixup -m"" > > Patch 2/2 doesn't seem to have made it to the list... Oops, here it comes. >> 2: bd78a211ed ! 2: 780de6e042 commit: add support for --fixup >> -m"" >> @@ -22,6 +22,21 @@ >> In such a case you might want to leave a small message, >> e.g. "forgot this part, which broke XYZ". >> >> +With this, --fixup -m"More" -m"Details" will result in a >> +commit message like: >> + >> +!fixup > >> + >> +More >> + >> +Details >> + >> +The reason the test being added here seems to squash "More" at the >> end >> +of the subject line of the commit being fixed up is because the test >> +code is using "%s%b" so the body immediately follows the subject, >> it's >> +not a bug in this code, and other tests t7500-commit.sh do the same >> +thing. > > Did you also intend to mention something about --edit still working > with -m? (Or do we assume that people will understand automatically > that it does?) I thought it was clear enough since it works with --fixup now and with everything else, and the commit message was already getting long enough...
Re: [PATCH v2 0/2] support -m"" combined with commit --fixup
On Fri, Dec 22, 2017 at 11:00 AM, Ævar Arnfjörð Bjarmason wrote: > Here's a hopefully ready to apply v2 incorporating feedback from Eric > (thanks!). A tbdiff with v1 follows below. > > Ævar Arnfjörð Bjarmason (2): > commit doc: document that -c, -C, -F and --fixup with -m error > commit: add support for --fixup -m"" Patch 2/2 doesn't seem to have made it to the list... > 2: bd78a211ed ! 2: 780de6e042 commit: add support for --fixup > -m"" > @@ -22,6 +22,21 @@ > In such a case you might want to leave a small message, > e.g. "forgot this part, which broke XYZ". > > +With this, --fixup -m"More" -m"Details" will result in a > +commit message like: > + > +!fixup > > + > +More > + > +Details > + > +The reason the test being added here seems to squash "More" at the > end > +of the subject line of the commit being fixed up is because the test > +code is using "%s%b" so the body immediately follows the subject, > it's > +not a bug in this code, and other tests t7500-commit.sh do the same > +thing. Did you also intend to mention something about --edit still working with -m? (Or do we assume that people will understand automatically that it does?)
[PATCH v2 0/2] support -m"" combined with commit --fixup
Here's a hopefully ready to apply v2 incorporating feedback from Eric (thanks!). A tbdiff with v1 follows below. Ævar Arnfjörð Bjarmason (2): commit doc: document that -c, -C, -F and --fixup with -m error commit: add support for --fixup -m"" Documentation/git-commit.txt | 2 ++ builtin/commit.c | 8 +--- t/t7500-commit.sh| 9 - 3 files changed, 15 insertions(+), 4 deletions(-) 1: 7d5e2531ee ! 1: 82333992ec commit doc: document that -c, -C, -F and --fixup with -m error @@ -7,6 +7,7 @@ explicitly since 0c091296c0 ("git-commit: log parameter updates.", 2005-08-08), but the documentation was never updated to reflect this. +Wording-by: Eric Sunshine Signed-off-by: Ævar Arnfjörð Bjarmason diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt @@ -17,8 +18,8 @@ If multiple `-m` options are given, their values are concatenated as separate paragraphs. ++ -+Combining the `-m` option and any of `-c`, `-C`, `-F` or `--fixup` -+will result in an error. ++The `-m` option is mutually exclusive with `-c`, `-C`, `-F`, and ++`--fixup`. -t :: --template=:: 2: bd78a211ed ! 2: 780de6e042 commit: add support for --fixup -m"" @@ -22,6 +22,21 @@ In such a case you might want to leave a small message, e.g. "forgot this part, which broke XYZ". +With this, --fixup -m"More" -m"Details" will result in a +commit message like: + +!fixup > + +More + +Details + +The reason the test being added here seems to squash "More" at the end +of the subject line of the commit being fixed up is because the test +code is using "%s%b" so the body immediately follows the subject, it's +not a bug in this code, and other tests t7500-commit.sh do the same +thing. + When the --fixup option was initially added the "Option -m cannot be combined" error was expanded from -c, -C and -F to also include --fixup[1] @@ -34,6 +49,7 @@ 1. d71b8ba7c9 ("commit: --fixup option for use with rebase --autosquash", 2010-11-02) +Helped-by: Eric Sunshine Signed-off-by: Ævar Arnfjörð Bjarmason diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt @@ -43,10 +59,9 @@ If multiple `-m` options are given, their values are concatenated as separate paragraphs. + --Combining the `-m` option and any of `-c`, `-C`, `-F` or `--fixup` --will result in an error. -+Combining the `-m` option and any of `-c`, `-C` or `-F` will result in -+an error. +-The `-m` option is mutually exclusive with `-c`, `-C`, `-F`, and +-`--fixup`. ++The `-m` option is mutually exclusive with `-c`, `-C`, and `-F`. -t :: --template=:: -- 2.15.1.424.g9478a66081