All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org
Subject: Re: [RFC/PATCH 2/2] messages: uniform error messages for index write
Date: Mon, 01 Jun 2015 16:01:14 -0700	[thread overview]
Message-ID: <xmqqsiab3uf9.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <0835711582b9db4ee067f2ea1fb767e0df13c4a0.1433166363.git.git@drmicha.warpmail.net> (Michael J. Gruber's message of "Mon, 1 Jun 2015 15:50:05 +0200")

Michael J Gruber <git@drmicha.warpmail.net> writes:

> * Leave "temporary" in place and add TRANSLATORS note.
>   It may happen that the index file is writable but not the temporary
>   one.
>
> * Leave pack-write.c alone.
>   It is low level without l10n.
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
> I am actually a bit torn on the "temporary index" messages. On the one hand
> we should hide technicalities from the user; on the other hand, we should give
> helpful information for debugging.
>
> Maybe "new index" and "temporary index" are really in the same camp? I would
> omit "temporary" in that case, too.

It is true that we never overwrite the file in-place, but instead
create a new file and then rename it to the destiation.  So in that
sense, we are always writing "new index file".

There however indeed is a different kind of "temporary" index
involved, when you are doing "git commit paths" to create a partial
commit.  We populate a pristine (relative to HEAD) index, update the
contents of it with the working tree contents at specified paths in
order to write the tree out, but do not use that index after that.
The real index is updated the same way for the specified paths to
match what was committed, but what was added to the real index
outside the specified paths before the partial commit was made is
all kept in the real index.  The presense of this "temporary" index
is something the end users may have to be aware of, if they want to
peek into the state of the index from inside their hooks, so in that
sense, it may make sense to include the word "temporary" in the
error message in that codepath.

      reply	other threads:[~2015-06-01 23:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 13:50 [PATCH 0/2] uniform error messages for index read and write Michael J Gruber
2015-06-01 13:50 ` [PATCH 1/2] show-index: uniform error messages for index read Michael J Gruber
2015-06-01 13:50 ` [RFC/PATCH 2/2] messages: uniform error messages for index write Michael J Gruber
2015-06-01 23:01   ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqsiab3uf9.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@drmicha.warpmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.