From: Junio C Hamano <junkio@cox.net>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Combined diff format documentation
Date: Wed, 25 Oct 2006 16:24:19 -0700 [thread overview]
Message-ID: <7vslhcj7x8.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <ehoq5r$8h5$1@sea.gmane.org> (Jakub Narebski's message of "Thu, 26 Oct 2006 00:58:39 +0200")
Jakub Narebski <jnareb@gmail.com> writes:
> Well, the _documentation_ doesn't tell. I haven't fully grokked the code
> for generating and coloring combined diff output besides the fact that
> I think it uses last indicator ('+' or '-') to chose color for the rest
> of line. You said that even if the possibility exist, it is extreme
> unlikely.
Well if I said that I must have been on booze ;-).
A '-' in the nth column means that the line is from the nth
parent and does _not_ appear in the merge result. A '+' in the
nth column means that the line _appears_ in the merge result,
and the nth parent does not have that line (i.e. added by the
merge itself, or inherited from other parents).
Hence, by definition, you cannot have '-' and '+' on the same
line (otherwise the line has to exist and not exist in the merge
result at the same time).
A ' ' is a bit tricky to interpret. A ' ' on a line _without_
any '-' means the line is the same as in that parent and the
merge result (i.e. the result inherited the line from that
parent). A ' ' on a line that has '-' talks nothing about the
merge result (because by definition '-' lines do not exist in
the merge result) nor the parent that has ' '; in other words,
it is a "don't care" bit. In the example you quoted from the
commit log of af3feefa:
- static void describe(char *arg)
-static void describe(struct commit *cmit, int last_one)
++static void describe(char *arg, int last_one)
{
The first parent had it as one-arg function, and the second one
two-arg but the first parameter was of type "struct commit *";
the merge result has it as two-arg with the first parameter of
type "char *". The second parent does not know about the
one-arg form of the function so it has ' ' in its column for the
first line.
All versions start the function with an opening brace '{' so the
line has two ' ' prefixed, which is an example of ' ' on a line
without any '-'.
next prev parent reply other threads:[~2006-10-25 23:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-25 22:22 Combined diff format documentation Jakub Narebski
2006-10-25 22:40 ` Junio C Hamano
2006-10-25 22:58 ` Jakub Narebski
2006-10-25 23:14 ` Junio C Hamano
2006-10-25 23:24 ` Junio C Hamano [this message]
2006-10-25 23:45 ` Jakub Narebski
2006-10-26 1:48 ` Horst H. von Brand
2006-10-26 3:04 ` Junio C Hamano
2006-10-26 3:44 ` [PATCH] diff-format.txt: Combined diff format documentation supplement Jakub Narebski
2006-10-26 6:15 ` Junio C Hamano
2006-10-26 7:05 ` Junio C Hamano
2006-10-26 7:10 ` Junio C Hamano
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=7vslhcj7x8.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=jnareb@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox