From: Jakub Narebski <jnareb@gmail.com>
To: Michael Dressel <MichaelTiloDressel@t-online.de>
Cc: Alex Riesen <raa.lkml@gmail.com>, git@vger.kernel.org
Subject: Re: git merge --no-commit <branch>; does commit
Date: Sat, 15 Dec 2007 12:57:58 -0800 (PST) [thread overview]
Message-ID: <m33au3r7zf.fsf@roke.D-201> (raw)
In-Reply-To: <alpine.LSU.0.99999.0712152117060.5151@castor.milkiway.cos>
Michael Dressel <MichaelTiloDressel@t-online.de> writes:
> On Sat, 15 Dec 2007, Jakub Narebski wrote:
>> Michael Dressel <MichaelTiloDressel@t-online.de> writes:
>>>
>>> Since "git merge --squash <branch>" does a merge of <branch> into the
>>> working tree why would you not call it a merge?
>>
>> A few illustrations. Commits A, B, C were made on 'trunk', commits
>> a, b, c were made on 'branch'. You are on 'trunk', running
>> "git merge <options> branch". We assume that there are no conflicts.
>>
>> 1. A non fast-forward case
>>
>> 1---2---3---A---B---C <-- trunk <-- HEAD
>> \
>> \-a---b---c <-- branch
>> 1.2. "git merge --no-commit branch"
>>
>> /-------- trunk <-- HEAD
>> v
>> 1---2---3---A---B---C--*
>> \ /
>> \-a---b---c/ <-- branch
>> ^
>> \-------- MERGE_HEAD
>>
>> The merge commit '*' is prepared, but not yet committed, just
>> as if there were merge conflict during merge. "git commit"
>> would commit a merge (and would tell you that it does a merge
>> commit).
>> 1.4. "git merge --squash branch"
>>
>> 1---2---3---A---B---C--[abc]' <-- trunk <-- HEAD
>> \
>> \-a---b---c <-- branch
>>
>> "[abc]'" is a _single parent_ commit (it is not a merge commit!)
>> which incorporates changes made on branch as if it were made in
>> a single, large (!) commit.
>
> Thanks alot for the elaborate explanations.
You are welcome
>> Test of understanding the concepts: what does
>> "git merge --squash --no-commit" does?
>>
>
> From the man page it sounds "git merge --squash --no-commit" would do
> the same as "git merge --squash". So in the example 1.4 [abc] should
> not be a commit.
/---------\
v \
1---2---3---A---B---C--*[abc]' \-- trunk <-- HEAD
\
\-a---b---c <-- branch
where *[abc]' is prepared state (staged but not committed changes)
squashing achanges into commits a, b, c into trunk.
Note that using "git rebase --interactive" you can squash, reorder
and edit commits; if you rather work in this way, reordering, editing
etc. "on the go" you perhaps should consider patch-management
interfaces like StGIT (Stacked GIT) or Guilt (formerly gq).
BTW. in practice [abc]' in squash case is the same as M in normal
case, only M has two parents recorded, and [abc]' does not.
--
Jakub Narebski
Poland
ShadeHawk on #git
next prev parent reply other threads:[~2007-12-15 20:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-13 21:01 git merge --no-commit <branch>; does commit Michael Dressel
2007-12-13 21:19 ` Alex Riesen
2007-12-13 21:23 ` Alex Riesen
2007-12-13 21:28 ` Michael Dressel
2007-12-14 7:49 ` Alex Riesen
2007-12-15 18:14 ` Michael Dressel
2007-12-15 18:26 ` Björn Steinbrink
2007-12-15 19:18 ` Jakub Narebski
2007-12-15 20:22 ` Michael Dressel
2007-12-15 20:57 ` Jakub Narebski [this message]
2007-12-15 21:15 ` Michael Dressel
2007-12-15 19:37 ` Alex Riesen
2007-12-15 20:33 ` Michael Dressel
2007-12-16 10:53 ` Alex Riesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m33au3r7zf.fsf@roke.D-201 \
--to=jnareb@gmail.com \
--cc=MichaelTiloDressel@t-online.de \
--cc=git@vger.kernel.org \
--cc=raa.lkml@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.