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

Re: [Q] merge squash unexpected conflicts

From
CSCory Sharp <cory.sharp@gmail.com>
Date
May 14, 2009, 14:47 UTC
Message-ID
<bb9d69200905140747j60b2e09flaabbb4db09b371b4@mail.gmail.com>
In-Reply-To
<4A0C0BDF.9020803@drmicha.warpmail.net>

On Thu, May 14, 2009 at 5:17 AM, Michael J Gruber <git@drmicha.warpmail.net> wrote:

Show 36 quoted lines
> Cory Sharp venit, vidit, dixit 14.05.2009 05:57:
>> On Wed, May 13, 2009 at 8:21 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Cory Sharp <cory.sharp@gmail.com> writes:
>>>
>>>> Am I doing something a little wrong or unexpected?  Is there a way
>>>> around this squash conflict behavior?  This doesn't seem to happen
>>>> with plain merge without squash.
>>>
>>> Of course.  That's the whole point of recording a merge as a merge.
>>>
>>
>> $ git help merge
>>
>>   --squash
>>            Produce the working tree and index state as if a real merge
>> happened. ... This allows you to create a
>>            single commit on top of the current branch whose effect is
>> the same as merging another branch.
>
> The problem is simply in the "...". You cut out the vital part:
>
>
>        but do not actually make a commit or
>        move the `HEAD`, nor record `$GIT_DIR/MERGE_HEAD` to
>        cause the next `git commit` command to create a merge
>        commit.
>
> See? Tree: yes, index: yes, merge info: no.
>
> Git does perform a (tree) merge with --squash, but records the resulting
> tree as an ordinary non-merge commit (with a single parent).
>
> I'm not sure whether the statement about the index is completely
> correct, though. During a merge the index records info about the merge
> (stages :1: etc.) but that as missing with --squash. Only the resulting
> tree is added to the index. How about the below?

Now I see, thanks for the help. The elided part, at the time I elided it, did not make me understand that merge info was not written, particularly when surrounded by its original accompanying text.

Thanks again, Cory

Previous: Michael J Gruber
Message 11 of 11 in “Re: [Q] merge squash unexpected conflicts”
  1. Cory SharpMay 14, 2009
  2. Junio C HamanoMay 14, 2009
  3. Cory SharpMay 14, 2009
  4. Junio C HamanoMay 14, 2009
  5. Cory SharpMay 14, 2009
  6. Junio C HamanoMay 14, 2009
  7. Cory SharpMay 14, 2009
  8. Michael RadziejMay 14, 2009
  9. Cory SharpMay 14, 2009
  10. Michael J GruberMay 14, 2009
  11. Cory SharpMay 14, 2009

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.