From: Johannes Sixt <j6t@kdbg.org>
To: Igor Djordjevic <igor.d.djordjevic@gmail.com>
Cc: git@vger.kernel.org, Nikolay Shustov <nikolay.shustov@gmail.com>,
Johannes Schneider <mailings@cedarsoft.com>,
Patrik Gornicz <patrik-git@mail.pgornicz.com>,
Martin Waitz <tali@admingilde.org>,
Shawn Pearce <spearce@spearce.org>, Sam Vilain <sam@vilain.net>,
Jakub Narebski <jnareb@gmail.com>
Subject: Re: [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge, no working tree file changes)
Date: Fri, 1 Dec 2017 18:23:43 +0100 [thread overview]
Message-ID: <33e97533-716b-e1cc-6aa0-bf8941225319@kdbg.org> (raw)
In-Reply-To: <741dfedc-07f8-24fb-ebe2-940f8b2639d4@gmail.com>
Am 30.11.2017 um 00:10 schrieb Igor Djordjevic:
> On 29/11/2017 20:11, Johannes Sixt wrote:
>> With git-post, I make a fixup commit commit on the integration
>> branch, then `git post B && git merge B`:
>>
>> ...A ...C <- topics A, C
>> \ \
>> ---o---o---o---o---f---F <- integration
>> / / /
>> ...B ...D / <- topic D
>> \ /
>> f'----------' <- topic B
>>
>> The merge F does not introduce any changes on the integration branch,
>> so I do not need it, but it helps keep topic B off radar when I ask
>> `git branch --no-merged` later.
>
> But you`re not committing (posting) on your HEAD`s (direct) parent in
> the first place (topic B), so `commit --onto-parent` isn`t right tool
> for the job... yet :)
Ohh..kay.
> To work with `--onto-parent` and be able to commit on top of any of
> the topic branches, you would need a situation like this instead:
>
> (1) ...C <- topic C
> |
> ...A | <- topic A
> \|
> ...o I <- integration
> /|
> ...B | <- topic B
> |
> ...D <- topic D
This is a very, VERY exotic workflow, I would say. How would you
construct commit I when three or more topics have conflicts?
merge-octopus does not support this use-case.
> With `commit --onto-parent` you would skip `git post B && git merge
> B` steps, where "fixup commit" would be done with `--onto-parent B`,
> So you end up in situation like this:
>
> (2) ...C <- topic C
> |
> ...A | <- topic A
> \|
> ...o I' <- integration
> /|
> ...B---f | <- topic B
> |
> ...D <- topic D
>
> State of index and working tree files in your F and my I' commit is
> exactly the same (I' = I + f), where in my case (2) history looks
> like "f" was part of topic B from the start, before integration
> merge happened.
>
> BUT, all this said, I understand that your starting position, where
> not all topic branches are merged at the same time (possibly to keep
> conflict resolution sane), is probably more often to be encountered
> in real-life work... and as existing `--onto-parent` machinery should
> be able to support it already, I`m looking forward to make it happen :)
>
> Once there, starting from your initial position:
>
>> ...A ...C <- topics A, C
>> \ \ E
>> ---o---o---o---o I <- integration <- HEAD
>> / /
>> ...B ...D <- topics B, D
>
> ... and doing something like `git commit --onto B --merge` would yield:
>
> (3) ...A ...C <- topics A, C
> \ \ E
> ---o---o---o---o I' <- integration
> / /|
> ...B ...D | <- topic D
> \ |
> f-------' <- topic B
>
> ... where (I' = I + f) is still true.
I am not used to this picture. I would not think that it is totally
unacceptable, but it still has a hmm-factor.
> If that`s preferred in some
> cases, it could even look like this instead:
>
> (4) ...A ...C <- topics A, C
> \ \ E I
> ---o---o---o---o---F <- integration
> / / /
> ...B ...D / <- topic D
> \ /
> f-------' <- topic B
>
> ... where F(4) = I'(3), so similar situation, just that we don`t
> discard I but post F on top of it.
This is very acceptable.
Nevertheless, IMO, it is not the task of git-commit to re-compute a
merge commit. It would be OK that it commits changes on top of a branch
that is not checked out. Perhaps it would even be OK to remove the
change from the current workspace (index and worktree), because it will
return in the form of a merge later, but producing that merge is
certainly not the task of git-commit.
-- Hannes
next prev parent reply other threads:[~2017-12-01 17:23 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-26 22:35 [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge, no working tree file changes) Igor Djordjevic
2017-11-26 22:36 ` [SCRIPT/RFC 1/3] setup.sh Igor Djordjevic
2017-11-26 22:36 ` [SCRIPT/RFC 2/3] git-merge-one-file--cached Igor Djordjevic
2017-11-26 22:45 ` [SCRIPT/RFC 3/3] git-commit--onto-parent.sh Igor Djordjevic
2017-11-27 21:54 ` [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge, no working tree file changes) Johannes Sixt
2017-11-28 1:15 ` Igor Djordjevic
2017-11-29 19:11 ` Johannes Sixt
2017-11-29 23:10 ` Igor Djordjevic
2017-12-01 17:23 ` Johannes Sixt [this message]
2017-12-04 2:33 ` Igor Djordjevic
2017-12-06 18:34 ` Johannes Sixt
2017-12-06 18:40 ` Junio C Hamano
2017-12-08 0:15 ` Igor Djordjevic
2017-12-08 16:24 ` Junio C Hamano
2017-12-08 23:54 ` Igor Djordjevic
2017-12-09 2:18 ` Alexei Lozovsky
2017-12-09 3:03 ` Igor Djordjevic
2017-12-09 19:00 ` [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge,noworking " Phillip Wood
2017-12-09 19:01 ` [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge, noworking " Phillip Wood
2017-12-10 1:20 ` Igor Djordjevic
2017-12-10 12:22 ` [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge,noworking " Phillip Wood
2017-12-10 23:17 ` Igor Djordjevic
2017-12-11 1:13 ` Alexei Lozovsky
2017-12-11 1:00 ` Alexei Lozovsky
2017-11-30 22:40 ` [SCRIPT/RFC 0/3] git-commit --onto-parent (three-way merge, no working " Chris Nerwert
2017-12-03 23:01 ` Igor Djordjevic
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=33e97533-716b-e1cc-6aa0-bf8941225319@kdbg.org \
--to=j6t@kdbg.org \
--cc=git@vger.kernel.org \
--cc=igor.d.djordjevic@gmail.com \
--cc=jnareb@gmail.com \
--cc=mailings@cedarsoft.com \
--cc=nikolay.shustov@gmail.com \
--cc=patrik-git@mail.pgornicz.com \
--cc=sam@vilain.net \
--cc=spearce@spearce.org \
--cc=tali@admingilde.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).