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 18, 2019, 00:41 UTC
Message-ID
<CAOc6etYM6DSDQ_H=eJs1xuGU9a83kTe2-vEy9+FEgHobT77_Eg@mail.gmail.com>
In-Reply-To
<xmqq5zo01qnv.fsf@gitster-ct.c.googlers.com>
On Wed, Jul 17, 2019 at 12:07 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
>
> Sure.  I started skimming and then gave up after seeing that quite a
> lot of code has been shuffled around without much explanation (e.g.
> printing of "Squash commit -- not updating HEAD" is gone from the
> callee and now it is a responsibility of the caller), making it
> harder than necessary to see if there is any unintended behaviour
> change when the new feature is not in use.  Whatever you are trying,
> it does look like the change deserves to be split into a smaller
> pieces to become more manageable.
>
> Thanks.
>
yw!

I'm focusing on the squash --commit part only. I think I'm close to getting the desired result and now I'm taking a close look at the unit tests and a question came up on two tests of t7600-merge.sh:

merge c0 with c1 (squash) merge c0 with c1 (squash, ff-only)

In both cases it's a FF (right?) so no new revision is created. The unit tests are requiring that $GIT_DIR/squash_msg have some content:

not ok 20 - merge c0 with c1 (squash, ff-only) # # git reset --hard c0 && # git merge --squash --ff-only c1 && # verify_merge file result.1 && # verify_head $c0 && # verify_no_mergehead && # test_cmp squash.1 .git/SQUASH_MSG

not ok 18 - merge c0 with c1 (squash) # # git reset --hard c0 && # git merge --squash c1 && # verify_merge file result.1 && # verify_head $c0 && # verify_no_mergehead && # test_cmp squash.1 .git/SQUASH_MSG

Does it make sense to keep this file in those two situations?
Previous: Junio C HamanoNext: Edmundo Carmona Antoranz
Message 6 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.