git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-update-index.txt: reword possibly confusing example
Date: Wed, 08 Aug 2018 14:31:13 -0700	[thread overview]
Message-ID: <xmqqzhxweeam.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180808202807.15350-1-newren@gmail.com> (Elijah Newren's message of "Wed, 8 Aug 2018 13:28:07 -0700")

Elijah Newren <newren@gmail.com> writes:

> The following phrase could be interpreted multiple ways:
>   "To pretend you have a file with mode and sha1 at path"
>
> In particular, I can think of two:
>   1. Pretend we have some new file, which happens to have a given mode
>      and sha1
>   2. Pretend one of the files we are already tracking has a different
>      mode and sha1 than what it really does
>
> I think people could easily assume either case while reading, but the
> example command provided doesn't actually handle the first case, which
> caused some minor frustration to at least one user.  Modify the example
> command so that it correctly handles both cases, and re-order the
> wording in a way that makes it more likely folks will assume the first
> interpretation.

I do not think the rephrasing loses those who want to update an
existing path, and is a good one.

> -To pretend you have a file with mode and sha1 at path, say:
> +To pretend you have a file at path with mode and sha1, say:
>  
>  ----------------
> -$ git update-index --cacheinfo <mode>,<sha1>,<path>
> +$ git update-index --add --cacheinfo <mode>,<sha1>,<path>
>  ----------------

      reply	other threads:[~2018-08-08 21:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 20:28 [PATCH] git-update-index.txt: reword possibly confusing example Elijah Newren
2018-08-08 21:31 ` Junio C Hamano [this message]

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=xmqqzhxweeam.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=newren@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.
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).