From: Junio C Hamano <gitster@pobox.com>
To: Edward Thomson <ethomson@microsoft.com>
Cc: "git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Rename conflicts in the index
Date: Tue, 26 Mar 2013 12:24:47 -0700 [thread overview]
Message-ID: <7vboa6t14w.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <A54CE3E330039942B33B670D971F857403A0AA7A@TK5EX14MBXC253.redmond.corp.microsoft.com> (Edward Thomson's message of "Tue, 26 Mar 2013 18:30:29 +0000")
Edward Thomson <ethomson@microsoft.com> writes:
> I would propose a new extension, 'CONF', to handle conflict data, differing
> from the stage >0 entries in the index in that this extension tracks the
> conflicting file across names if the underlying merge engine has support
> for renames.
>
> I made an attempt to keep the entry data similar to other entries in the
> index. I would propose that entries in the conflict are as follows:
>
> Flags
> Four octets that describe the conflict. Data includes:
>
> 0x01 HAS_ANCESTOR
> There is a file in the common ancestor branch that contributes
> to this conflict. Its data will follow.
> 0x02 HAS_OURS
> There is a file in "our" branch that contributes to this conflict.
> Its data will follow.
> 0x04 HAS_THEIRS
> There is a file in "their" branch that contributes to this conflict.
> Its data will follow.
>
> 0x08 NAME_CONFLICT_OURS
> This item has a path in "our" branch that overlaps a different
> item in "their" branch. (Eg, this conflict represents the "our"
> side of a rename/add conflict.)
> 0x10 NAME_CONFLICT_THEIRS
> This item has a path in "their" branch that overlaps a different
> item in "our" branch. (Eg, this conflict represents the "theirs"
> side of a rename/add conflict.)
>
> 0x20 DF_CONFLICT_FILE
> This is the file involved in a directory/file conflict.
> 0x40 DF_CONFLICT_CHILD
> This is a child of a directory involved in a directory/file conflict.
>
> Other bits are reserved.
>
> Conflict Sides
> The data about one side of a conflict will contain:
> mode (ASCII string representation of octal, null-terminated)
> path (null terminated)
> sha1 (raw bytes)
>
> The conflict sides will be written in this order:
> Ancestor (if HAS_ANCESTOR is set)
> Ours (if HAS_OURS is set)
> Theirs (if HAS_THEIRS is set)
Puzzled. Most of the above, except NAME_CONFLICT_{OURS,THEIRS}
bits, look totally pointless duplication.
When you are working with Git, you have to be prepared to read from
the datafile like the index that other people (and your previous
version) created, and you also have to make sure you do not make
what you write out unusable by other people without a good reason.
So your tool needs code to see higher stage entries in the main
index to find <mode,sha1> for the conflicted paths even without the
index extension anyway, and if your tool does also perform merges,
you would need to strive for writing the main index with conflicted
entries and implementations that do not yet understand your
extension can keep operating. For some types of extensions, the
latter may be hard (and that is why I stopped at "you would need to
strive for", and not "you must"), but for the one under discussion,
I do not think it is the case (by the way "CONF" sounds as if it is
some sort of configuration data).
If you are starting a brand new system from scratch, keeping only
the resolved entries in the main index and having a separate section
for conflicts might be also a valid design choice, but you do not
live in that world if you are discussing the design on this mailing
list.
> I would propose that this not simply track rename conflicts, but all
> conflicts.
That is a no starter.
next prev parent reply other threads:[~2013-03-26 19:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-13 14:08 Rename conflicts in the index Edward Thomson
2013-03-13 18:05 ` Junio C Hamano
2013-03-13 20:44 ` Edward Thomson
2013-03-26 18:30 ` Edward Thomson
2013-03-26 19:24 ` Junio C Hamano [this message]
2013-03-26 20:40 ` Edward Thomson
2013-03-27 17:03 ` Edward Thomson
2013-03-27 17:34 ` Junio C Hamano
2013-03-27 18:53 ` Edward Thomson
2013-03-27 19:44 ` Junio C Hamano
2013-04-01 16:14 ` Edward Thomson
2013-04-02 20:55 ` Edward Thomson
2013-04-02 21:20 ` Junio C Hamano
2013-04-02 21:29 ` Edward Thomson
[not found] ` <A54CE3E330039942B33B670D971F857403A0F593@TK5EX14MBXC253.redmond.cor p.microsoft.com>
2013-04-03 0:53 ` Junio C Hamano
2013-04-03 0:57 ` 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=7vboa6t14w.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=ethomson@microsoft.com \
--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).