{"thread":{"id":"25372","subject":"[PATCH] New commit option --fixup.","startedAt":"2010-10-06T22:58:21Z","lastAt":"2010-10-07T08:35:43Z","messageCount":4,"participants":["Rodolfo Borges","Pat Notz","Sverre Rabbelier","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"152829","messageId":"1286405901-13586-1-git-send-email-rodolfo.borges@gmail.com","threadId":"25372","inReplyTo":null,"subject":"[PATCH] New commit option --fixup.","fromName":"Rodolfo Borges","fromEmail":"rodolfo.borges@gmail.com","sentAt":"2010-10-06T22:58:21Z","receivedAt":"2010-10-06T22:58:21Z","isPatch":true,"sender":{"key":"rodolfo.borges@gmail.com","avatar":null},"body":"Equivalent of '-C HEAD --amend'.\nInspired by new 'fixup' rebase -i action.\n\nSigned-off-by: Rodolfo Borges <rodolfo.borges@gmail.com>\n---\n Documentation/git-commit.txt |    4 ++++\n builtin/commit.c             |    8 +++++++-\n 2 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex 42fb1f5..faba634 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -180,6 +180,10 @@ You should understand the implications of rewriting history if you\n amend a commit that has already been published.  (See the \"RECOVERING\n FROM UPSTREAM REBASE\" section in linkgit:git-rebase[1].)\n \n+--fixup::\n+\tLike '--amend', but use previous commit message.\n+\t(Equivalent to `--amend -C HEAD`.)\n+\n -i::\n --include::\n \tBefore making a commit out of staged contents so far,\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 66fdd22..fd7c145 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -70,7 +70,7 @@ static const char *logfile, *force_author;\n static const char *template_file;\n static char *edit_message, *use_message;\n static char *author_name, *author_email, *author_date;\n-static int all, edit_flag, also, interactive, only, amend, signoff;\n+static int all, edit_flag, also, interactive, only, amend, fixup, signoff;\n static int quiet, verbose, no_verify, allow_empty, dry_run, renew_authorship;\n static int no_post_rewrite, allow_empty_message;\n static char *untracked_files_arg, *force_date, *ignore_submodule_arg;\n@@ -147,6 +147,7 @@ static struct option builtin_commit_options[] = {\n \tOPT_BOOLEAN('z', \"null\", &null_termination,\n \t\t    \"terminate entries with NUL\"),\n \tOPT_BOOLEAN(0, \"amend\", &amend, \"amend previous commit\"),\n+\tOPT_BOOLEAN(0, \"fixup\", &fixup, \"fixup previous commit\"),\n \tOPT_BOOLEAN(0, \"no-post-rewrite\", &no_post_rewrite, \"bypass post-rewrite hook\"),\n \t{ OPTION_STRING, 'u', \"untracked-files\", &untracked_files_arg, \"mode\", \"show untracked files, optional modes: all, normal, no (Default: all)\", PARSE_OPT_OPTARG, NULL, (intptr_t)\"all\" },\n \t/* end commit contents options */\n@@ -863,6 +864,11 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \tif (force_author && renew_authorship)\n \t\tdie(\"Using both --reset-author and --author does not make sense\");\n \n+\tif (fixup) {\n+\t\tamend = 1;\n+\t\tuse_message = \"HEAD\";\n+\t}\n+\n \tif (logfile || message.len || use_message)\n \t\tuse_editor = 0;\n \tif (edit_flag)\n-- \n1.7.2.3\n"},{"id":"152833","messageId":"AANLkTimHz3sCDh-aicw1agi_mrL8pUztfi32vWv1pXUM@mail.gmail.com","threadId":"25372","inReplyTo":"1286405901-13586-1-git-send-email-rodolfo.borges@gmail.com","subject":"Re: [PATCH] New commit option --fixup.","fromName":"Pat Notz","fromEmail":"patnotz@gmail.com","sentAt":"2010-10-07T00:38:58Z","receivedAt":"2010-10-07T00:38:58Z","isPatch":true,"sender":{"key":"patnotz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45364?v=4"},"body":"On Wed, Oct 6, 2010 at 4:58 PM, Rodolfo Borges <rodolfo.borges@gmail.com> wrote:\n> Equivalent of '-C HEAD --amend'.\n> Inspired by new 'fixup' rebase -i action.\n>\n> Signed-off-by: Rodolfo Borges <rodolfo.borges@gmail.com>\n> ---\n>  Documentation/git-commit.txt |    4 ++++\n>  builtin/commit.c             |    8 +++++++-\n>  2 files changed, 11 insertions(+), 1 deletions(-)\n>\n> diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\n> index 42fb1f5..faba634 100644\n> --- a/Documentation/git-commit.txt\n> +++ b/Documentation/git-commit.txt\n> @@ -180,6 +180,10 @@ You should understand the implications of rewriting history if you\n>  amend a commit that has already been published.  (See the \"RECOVERING\n>  FROM UPSTREAM REBASE\" section in linkgit:git-rebase[1].)\n>\n> +--fixup::\n> +       Like '--amend', but use previous commit message.\n> +       (Equivalent to `--amend -C HEAD`.)\n> +\n\nWhy not just use an alias for this?  I do:\n\ngit config alias.fixup \"commit --amend -C HEAD\"\n\nAlso, I've been working on --fixup and --squash options for commit,\nunder the same inspiration.  See,\nhttp://thread.gmane.org/gmane.comp.version-control.git/156883\n\nI'm hoping to submit v5 patch series tomorrow night.\n\n>  -i::\n>  --include::\n>        Before making a commit out of staged contents so far,\n> diff --git a/builtin/commit.c b/builtin/commit.c\n> index 66fdd22..fd7c145 100644\n> --- a/builtin/commit.c\n> +++ b/builtin/commit.c\n> @@ -70,7 +70,7 @@ static const char *logfile, *force_author;\n>  static const char *template_file;\n>  static char *edit_message, *use_message;\n>  static char *author_name, *author_email, *author_date;\n> -static int all, edit_flag, also, interactive, only, amend, signoff;\n> +static int all, edit_flag, also, interactive, only, amend, fixup, signoff;\n>  static int quiet, verbose, no_verify, allow_empty, dry_run, renew_authorship;\n>  static int no_post_rewrite, allow_empty_message;\n>  static char *untracked_files_arg, *force_date, *ignore_submodule_arg;\n> @@ -147,6 +147,7 @@ static struct option builtin_commit_options[] = {\n>        OPT_BOOLEAN('z', \"null\", &null_termination,\n>                    \"terminate entries with NUL\"),\n>        OPT_BOOLEAN(0, \"amend\", &amend, \"amend previous commit\"),\n> +       OPT_BOOLEAN(0, \"fixup\", &fixup, \"fixup previous commit\"),\n>        OPT_BOOLEAN(0, \"no-post-rewrite\", &no_post_rewrite, \"bypass post-rewrite hook\"),\n>        { OPTION_STRING, 'u', \"untracked-files\", &untracked_files_arg, \"mode\", \"show untracked files, optional modes: all, normal, no (Default: all)\", PARSE_OPT_OPTARG, NULL, (intptr_t)\"all\" },\n>        /* end commit contents options */\n> @@ -863,6 +864,11 @@ static int parse_and_validate_options(int argc, const char *argv[],\n>        if (force_author && renew_authorship)\n>                die(\"Using both --reset-author and --author does not make sense\");\n>\n> +       if (fixup) {\n> +               amend = 1;\n> +               use_message = \"HEAD\";\n> +       }\n> +\n>        if (logfile || message.len || use_message)\n>                use_editor = 0;\n>        if (edit_flag)\n> --\n> 1.7.2.3\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"152857","messageId":"AANLkTi=c9zCKUnZp3B=m9C99FKOTtz+hY5-GvSXjozHD@mail.gmail.com","threadId":"25372","inReplyTo":"AANLkTimHz3sCDh-aicw1agi_mrL8pUztfi32vWv1pXUM@mail.gmail.com","subject":"Re: [PATCH] New commit option --fixup.","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-10-07T08:09:22Z","receivedAt":"2010-10-07T08:09:22Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Thu, Oct 7, 2010 at 02:38, Pat Notz <patnotz@gmail.com> wrote:\n> Why not just use an alias for this?  I do:\n>\n> git config alias.fixup \"commit --amend -C HEAD\"\n\nI have a similar alias:\n\ngit config alias.amendall \"commit --amend -a -C HEAD\"\n\nI don't think we need a command to do this, but I'm starting to think\nwe really should have a list of aliases either ship with git itself,\nor with the git documentation.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"152860","messageId":"AANLkTimQbYi=MmodFuyDdgeoYXQ42j2Jq4a+BmohGG0W@mail.gmail.com","threadId":"25372","inReplyTo":"AANLkTi=c9zCKUnZp3B=m9C99FKOTtz+hY5-GvSXjozHD@mail.gmail.com","subject":"Re: [PATCH] New commit option --fixup.","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-10-07T08:35:43Z","receivedAt":"2010-10-07T08:35:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Thu, Oct 7, 2010 at 08:09, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n> Heya,\n>\n> On Thu, Oct 7, 2010 at 02:38, Pat Notz <patnotz@gmail.com> wrote:\n>> Why not just use an alias for this?  I do:\n>>\n>> git config alias.fixup \"commit --amend -C HEAD\"\n>\n> I have a similar alias:\n>\n> git config alias.amendall \"commit --amend -a -C HEAD\"\n>\n> I don't think we need a command to do this, but I'm starting to think\n> we really should have a list of aliases either ship with git itself,\n> or with the git documentation.\n\nFWIW that's one of the things I want to do if I pick up my .gitconfig\ninclusion patch again. Have aliases files that ship with Git itself\nthat you can include in ~/.gitconfig.\n"}]}