From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Subject: Re: [RFC?] Telling git about more complex relationships between commits (Was: Re: FFmpeg considering GIT)
Date: Sat, 05 May 2007 18:13:41 +0200 [thread overview]
Message-ID: <200705051813.43897.johan@herland.net> (raw)
In-Reply-To: <20070504221152.GF4033@steel.home>
[-- Attachment #1: Type: text/plain, Size: 4260 bytes --]
On Saturday 05 May 2007, Alex Riesen wrote:
> Johan Herland, Fri, May 04, 2007 13:53:10 +0200:
> > As for "Reverts", the commit pointed to should already be in your
> > history, since you cannot revert something that hasn't already been
> > applied at an earlier point in your history. In other words, the
> > reverted commit will automatically be included in your "git gc
> > --prune" or "git clone" regardless of the "Reverts" fields, since
> > "Reverts" can only point to an ancestor.
>
> So it becomes useless after rebase
Only if rebase also rebases the commit pointed to by "Reverts" (the
reverted commit). And even in that case, it should be possible for
rebase to detect the "Reverts" relationship and rewrite it properly,
or - if people want to - skip both the reverted and the reverting
commit in the rebase process.
> > As for "Cherry-Pick", it's a fairly weak relationship that
> > shouldn't affect anything except to give a hint to merge, blame,
> > and similar tools.
>
> In which case, just put it in the message part of commit (in fact, it
> was there for some time. And was mostly useless, and got dropped).
Ok. If merging branches which have had cherry-picks between them is such
a rare occurrence that there is no point in adding hints for merge (to
do better conflict resolution), blame (to see who _really_ wrote the
piece of code that was cherry-picked by someone else), etc. then there
is indeed no justification for the "Cherry-Pick" header field.
> And how exactly do you think the tools _can_ use this hint?
> Especially merge, which should be absolutely certain about what
> inputs and hints gets.
When merging two branches where one branch has a commit that is later
reverted, and the other branch has cherry-picked the first/reverted
commit, but not the second/reverting: With these hints, git can now ask
the user a more intelligent question like "The following commit was
reverted in one of the branches. Do you want to keep it or revert it?".
The current alternative seems to be to auto-choose one or the other (in
my testing, the reverting commit was dropped in the merge). Will git
always make the correct decision? If git is always correct, then what I
suggest is obviously useless.
> And what use is it for blame? How do you prioritze the hint? Is it
> more important than the history (which describes each and every
> line), or less? If the hint is more important, than how (and how
> often) do you tell the user that the hint was not found (because the
> commit is long pruned) and the tool switched back to looking into
> history.
Consider the following scenario:
----
$ mkdir test
$ cd test
$ git init
Initialized empty Git repository in .git/
$ git config user.name "User A"
$ cat >f <<\EOF
foo
bar
baz
EOF
$ git add f && git commit -m "User A: foo, bar, baz"
Created initial commit bb0203aabb4936d95dca30f946cb1d849df59f24
1 files changed, 3 insertions(+), 0 deletions(-)
create mode 100644 f
$ git config user.name "User B"
$ cat >f <<\EOF
foo
barf
baz
EOF
$ git commit -a -m "User B: bar -> barf"
Created commit 5ced0ccaba0bf4a982dc2cdd792a1a0e7b1883eb
1 files changed, 1 insertions(+), 1 deletions(-)
$ git config user.name "User C"
$ git revert HEAD
Created commit 38da1083ae4677000f8bb70729f474f358c71a3e
1 files changed, 1 insertions(+), 1 deletions(-)
----
At this point, what output do we _really_ want from "git blame f"?
Currently we get:
----
^bb0203a (User A 2007-05-05 12:25:44 +0200 1) foo
38da1083 (User C 2007-05-05 12:28:00 +0200 2) bar
^bb0203a (User A 2007-05-05 12:25:44 +0200 3) baz
----
Can you categorically say that there is no use for the following output?
(even if you need to pass an option to "git blame" to get it):
----
^bb0203a (User A 2007-05-05 12:25:44 +0200 1) foo
^bb0203a (User A 2007-05-05 12:25:44 +0200 1) bar
^bb0203a (User A 2007-05-05 12:25:44 +0200 3) baz
----
> It's useless.
Maybe. At least some of the fields I proposed are probably useless. But
I don't think we should throw away the core idea unless we can show
that _all_ fields are useless.
Have fun!
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2007-05-05 16:14 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-02 9:29 FFmpeg considering GIT Panagiotis Issaris
2007-05-02 23:48 ` Jakub Narebski
2007-05-03 1:03 ` Petr Baudis
2007-05-04 0:42 ` Jakub Narebski
2007-05-04 7:21 ` [RFC?] Telling git about more complex relationships between commits (Was: Re: FFmpeg considering GIT) Johan Herland
2007-05-04 9:36 ` Alex Riesen
2007-05-04 11:39 ` Andy Parkins
2007-05-04 12:06 ` Andrew Ruder
2007-05-04 12:30 ` Johan Herland
2007-05-04 11:53 ` Johan Herland
2007-05-04 22:11 ` Alex Riesen
2007-05-05 12:49 ` Johan Herland
2007-05-05 18:03 ` Alex Riesen
2007-05-05 16:13 ` Johan Herland [this message]
2007-05-04 11:10 ` Petr Baudis
2007-05-04 12:22 ` Johan Herland
2007-05-03 1:48 ` FFmpeg considering GIT Martin Langhoff
2007-05-03 18:00 ` Uwe Kleine-König
2007-05-03 20:00 ` Petr Baudis
2007-05-03 20:05 ` david
2007-05-03 20:13 ` Petr Baudis
2007-05-04 13:46 ` Michael Niedermayer
2007-05-04 15:53 ` Andy Parkins
2007-05-04 16:09 ` Johannes Sixt
2007-05-04 17:23 ` Florian Weimer
2007-05-04 16:40 ` Nicolas Pitre
2007-05-04 18:17 ` Carl Worth
2007-05-04 18:25 ` Johan Herland
2007-05-04 20:24 ` Michael Niedermayer
2007-05-05 4:15 ` Linus Torvalds
2007-05-05 13:35 ` Karl Hasselström
2007-05-05 17:26 ` Linus Torvalds
2007-05-05 22:18 ` Linus Torvalds
2007-05-05 22:30 ` Linus Torvalds
2007-05-06 7:49 ` Junio C Hamano
2007-05-07 12:13 ` Paul Mackerras
2007-05-07 12:30 ` Karl Hasselström
2007-05-07 12:50 ` Johan Herland
2007-05-07 12:56 ` Alex Riesen
2007-05-08 6:30 ` Marco Costalba
2007-05-09 4:28 ` Paul Mackerras
2007-05-09 6:38 ` Marco Costalba
2007-05-09 18:17 ` Robin Rosenberg
2007-05-09 18:28 ` Jan Hudec
2007-05-09 21:09 ` Fredrik Kuivinen
2007-05-09 21:36 ` Jan Hudec
2007-05-10 11:20 ` Marco Costalba
2007-05-10 16:52 ` Jan Hudec
2007-05-07 17:52 ` Jan Hudec
2007-05-07 22:10 ` Gábor Farkas
2007-05-07 23:21 ` Randal L. Schwartz
[not found] ` <fcaeb9bf0705080707x7ad28afelf98ecd93276042d1@mail.gmail.com>
2007-05-08 15:53 ` Gábor Farkas
2007-05-07 19:10 ` Junio C Hamano
2007-05-08 2:03 ` Shawn O. Pearce
2007-05-08 7:26 ` Jeff King
2007-05-06 7:56 ` Karl Hasselström
2007-05-06 10:19 ` Karl Hasselström
2007-05-06 16:38 ` Linus Torvalds
2007-05-06 8:15 ` Marco Costalba
2007-05-06 11:14 ` Karl Hasselström
2007-05-06 12:19 ` Marco Costalba
2007-05-06 12:33 ` Karl Hasselström
2007-05-06 12:33 ` Marco Costalba
2007-05-06 12:59 ` Karl Hasselström
2007-05-06 13:03 ` Karl Hasselström
2007-05-09 22:30 ` Pavel Roskin
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=200705051813.43897.johan@herland.net \
--to=johan@herland.net \
--cc=git@vger.kernel.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.
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 NNTP newsgroup(s).