git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] builtin/merge: allow --squash to commit if there are no conflicts

From
Edmundo Carmona Antoranz <eantoranz@gmail.com>
Date
Jul 13, 2019, 05:27 UTC
Message-ID
<CAOc6etb_XFbQWDHg3YRNiskkntS0ro2MYgXCfp6oPv4LutQFGA@mail.gmail.com>
In-Reply-To
<20190713051804.12893-1-eantoranz@gmail.com>

On Fri, Jul 12, 2019 at 11:18 PM Edmundo Carmona Antoranz <eantoranz@gmail.com> wrote:

Show 21 quoted lines
> @@ -1342,18 +1354,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
>         if (verbosity < 0)
>                 show_diffstat = 0;
>
> -       if (squash) {
> -               if (fast_forward == FF_NO)
> -                       die(_("You cannot combine --squash with --no-ff."));
> -               if (option_commit > 0)
> -                       die(_("You cannot combine --squash with --commit."));
> -               /*
> -                * squash can now silently disable option_commit - this is not
> -                * a problem as it is only overriding the default, not a user
> -                * supplied option.
> -                */
> -               option_commit = 0;
> -       }
> +       if (squash && fast_forward == FF_NO)
> +               die(_("You cannot combine --squash with --no-ff."));
>
>         if (option_commit < 0)
>                 option_commit = 1;

One question that I have is if it makes sense to set option_commit to 0 if the user didn't specify --commit when using --squash, so that the current behavior of git is not broken. Like you run merge --squash, git will stop as it currently does... but it would be possible to run with --squash --commit so that the revision is created if there are no issues to take care of (currently impossible, you would see that message saying "You cannot combine --squash with --commit.").

Previous: Edmundo Carmona AntoranzNext: Junio C Hamano
Message 2 of 7 in “builtin/merge: allow --squash to commit if there are no conflicts”
  1. builtin/merge: allow --squash to commit if there are no conflictsEdmundo Carmona Antoranz, Jul 13, 2019
  2. Edmundo Carmona AntoranzJul 13, 2019
  3. Junio C HamanoJul 14, 2019
  4. Edmundo Carmona AntoranzJul 14, 2019
  5. Junio C HamanoJul 17, 2019
  6. Edmundo Carmona AntoranzJul 18, 2019
  7. Edmundo Carmona AntoranzJul 18, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.