git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Simon A. Eugster" <simon.eu@gmail.com>
Cc: git@vger.kernel.org, "Simon A. Eugster" <simon.eugster@eps.ch>
Subject: Re: [PATCH] Documentation clarification on git-checkout regarding ours/theirs
Date: Thu, 11 Jun 2015 08:37:27 -0700	[thread overview]
Message-ID: <xmqqwpzafe88.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1434022766-45397-1-git-send-email-simon.eu@gmail.com> (Simon A. Eugster's message of "Thu, 11 Jun 2015 13:39:26 +0200")

"Simon A. Eugster" <simon.eu@gmail.com> writes:

> From: "Simon A. Eugster" <simon.eugster@eps.ch>
>
> Signed-off-by: Simon A. Eugster <simon.eugster@eps.ch>
> ---
>  Documentation/git-checkout.txt | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
> index d263a56..5c3ef86 100644
> --- a/Documentation/git-checkout.txt
> +++ b/Documentation/git-checkout.txt
> @@ -115,7 +115,11 @@ entries; instead, unmerged entries are ignored.
>  --ours::
>  --theirs::
>  	When checking out paths from the index, check out stage #2
> -	('ours') or #3 ('theirs') for unmerged paths.
> +	('ours', HEAD) or #3 ('theirs', MERGE_HEAD) for unmerged paths.
> ++
> +After a `git pull --rebase`, for example, 'ours' points to the remote
> +version and 'theirs' points to the local version. See linkgit:git-merge[1]
> +for details about stages #2 and #3.

I think it is a good idea to mention that it takes a switching of
viewpoint [*1*] when reading ours/theirs during "git rebase" (and by
extension "git pull --rebase").

But I am afraid that it may be detrimental to say 'for example' and
mentioning _only that_ for two reasons:

 - it does not make it clear what is said in that paragraph is an
   exception, which would mislead those who are doing "git pull"
   without rebase (for them, --ours is their own work, --theirs is
   what they are pulling from outside).

 - it does not make it clear that the paragraph is giving a
   warning---many people who think they know what they are doing
   would stop reading carefully after seeing 'for example', so those
   who do use 'rebase' (either 'git rebase' or 'git pull --rebase')
   would miss the subtlety.

Perhaps rephrasing it to make it clear that this describes a warning
about an exception may be needed?  Starting the paragraph like so,
perhaps:

    Note that during `git rebase` and `git pull -rebase`, 'ours' and
    'theirs' may appear to be swapped (i.e. 'ours' is the history
    from the remote or the history onto which you are rebasing, and
    'theirs' is the history of your private work).  This is for such
    and such reasons...


[Footnote]

*1* The reason why ours/theirs appear to be swapped during a rebase
is because you are temporarily assuming the role of the keeper of
the canonical history while doing so.  A rebase is to treat the
history that came from the remote as the canonical one, and then
treat what you did as the "third party" work that need to be
integrated into the canonical history.  That makes what you obtained
from the remote "ours" (i.e. the shared history of our project we
collectively own) and yoru work "theirs" (i.e. other people's work
to be integrated into "our" shared history, but you happen to be
that "other people" in this case).

  reply	other threads:[~2015-06-11 15:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11 11:39 [PATCH] Documentation clarification on git-checkout regarding ours/theirs Simon A. Eugster
2015-06-11 15:37 ` Junio C Hamano [this message]
2015-06-15 12:47   ` [PATCH] Documentation clarification on git-checkout Simon A. Eugster
2015-06-15 12:47     ` [PATCH 1/2] Documentation clarification on git-checkout regarding ours/theirs Simon A. Eugster
2015-06-15 12:47     ` [PATCH 2/2] Documentation on git-checkout --ours/--theirs improved Simon A. Eugster
2015-06-15 20:10       ` Junio C Hamano
2015-06-16  7:03         ` Simon Eugster
2015-06-16 15:41           ` Junio C Hamano
2015-06-17 14:31             ` Simon Eugster
2015-06-17 15:10               ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2015-07-10  8:27 [PATCH] Documentation clarification on git-checkout regarding ours/theirs Simon A. Eugster
2015-07-10 20:07 ` Junio C Hamano
2015-07-11  5:26   ` Simon A. Eugster
2015-07-12 16:36     ` 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

  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=xmqqwpzafe88.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=simon.eu@gmail.com \
    --cc=simon.eugster@eps.ch \
    /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).