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

Re: [PATCH/RFC] git-merge.sh: better handling of combined --squash,--no-ff,--no-commit options

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 2, 2008, 23:50 UTC
Message-ID
<7vir04n0rt.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080302175820.31385.qmail@9e9c5b8314ca7b.315fe32.mid.smarden.org>
Gerrit Pape <pape@smarden.org> writes:
Show 14 quoted lines
> git-merge used to use either the --squash,--no-squash, --no-ff,--ff,
> --no-commit,--commit option, whichever came last in the command line.
> This lead to some un-intuitive behavior, having
>
>  git merge --no-commit --no-ff <branch>
>
> actually commit the merge.  Now git-merge respects --no-commit together
> with --no-ff, as well as other combinations of the options.  However,
> this broke a selftest in t/t7600-merge.sh which expected to have --no-ff
> completely override the --squash option, so that
>
>  git merge --squash --no-ff <branch>
>
> fast-forwards, and makes a merge commit; now it prepares a squash ...

Both make sense when they make sense (i.e. if you and the other side are not fast-forward nor up-to-date and need a real merge).

> ...  Combining --squash with --no-ff doesn't seem to make sense

Yeah, I think forbidding this combination would make much more sense. The former asks there be _no_ merge (the user does not want to have a merge ever), while the other one asks to create a merge even when there is no need to (the user does want a merge).

Are there other combinations that we should forbid?
Previous: Gerrit PapeNext: Gerrit Pape
Message 2 of 3 in “git-merge.sh: better handling of combined --squash,--no-ff,--no-commit options”
  1. git-merge.sh: better handling of combined --squash,--no-ff,--no-commit optionsGerrit Pape, Mar 2, 2008
  2. Junio C HamanoMar 2, 2008
  3. git-merge.sh: better handling of combined --squash,--no-ff,--no-commit optionsGerrit Pape, Mar 3, 2008

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.