git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Nathan Neulinger <nneul@neulinger.org>,
	Santiago Torres <santiago@nyu.edu>,
	git@vger.kernel.org,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: git status always modifies index?
Date: Sun, 26 Nov 2017 18:35:56 +0900	[thread overview]
Message-ID: <xmqq7eudidqb.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <xmqqwp2diuki.fsf@gitster.mtv.corp.google.com> (Junio C. Hamano's message of "Sun, 26 Nov 2017 12:32:13 +0900")

Junio C Hamano <gitster@pobox.com> writes:

> Jeff King <peff@peff.net> writes:
>
>> What I was trying to get at is that naming it "status --no-lock-index"
>> would not be the same thing (even though with the current implementation
>> it would behave the same). IOW, can we improve the documentation of
>> "status" to point to make it easier to discover this use case.
>
> Yeah, the name is unfortunate. 
>
> What the end user really wants to see, I suspect, is a "--read-only"
> option that applies to any filesystem entity and to any command, in
> the context of this thread, and also in the original discussion that
> led to the introduction of that option.  
>
> While I think the variable losing "index" from its name was a vast
> improvement relative to "--no-lock-index", simply because it
> expresses what we do a bit closer to "do not just do things without
> modifying anything my repository", it did not go far enough.

Yuck, the last sentence was garbled.  What I meant as the ideal
"read-only" was "do things without modifying anything in my
repository".

And to avoid any misunderstanding, what I mean by "it did not go far
enough" is *NOT* this:

    We added a narrow feature and gave it a narrow name.  Instead we
    should have added a "--read-only" feature, which this change may
    be a small part of, and waited releasing the whole thing until
    it is reasonably complete.

By going far enough, I was wondering if we should have done
something that we historically did not do.  An "aspirational"
feature that is incrementally released with a known bug and that
will give users what they want in the larger picture when completed.

IOW, we could have made this "git --read-only <cmd>", that is
explained initially as "tell Git not to modify repository when it
does not have to (e.g. avoid opportunistic update)" and perhaps
later as "tell Git not to modify anything in the repository--if it
absolutely has to (e.g. "git --read-only commit" is impossible to
complete without modifying anything in the repository), error out
instead".  And with a known-bug section to clearly state that this
feature is not something we vetted every codepath to ensure the
read-only operation, but is still a work in progress.

After all, "status" does not have to stay to be the only command
with opportunistic modification (in the current implementation, it
does "update-index --refresh" to update the index).  And the index
does not have to stay to be the only thing that is opportunistically
modified (e.g. "git diff --cached" could not just opportunistically
update the index, but also it could be taught to write out tree
objects for intermediate directories when it does its cache-tree
refresh, which would help the diff-index algorithm quite a bit in
the performance department).  

Having a large picture option like "--read-only" instead of ending
up with dozens of "we implemented a knob to tweak only this little
piece, and here is an option to trigger it" would help users in the
long run, but we traditionally did not do so because we tend to
avoid shipping "incomplete" features, but being perfectionist with
such a large undertaking can stall topics with feature bloat.  In a
case like this, however, I suspect that an aspirational feature that
starts small, promises little and can be extended over time may be a
good way to move forward.




  reply	other threads:[~2017-11-26  9:36 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-22 15:19 git status always modifies index? Nathan Neulinger
2017-11-22 15:30 ` Santiago Torres
2017-11-22 15:37   ` Nathan Neulinger
2017-11-22 16:10     ` Santiago Torres
2017-11-22 16:20       ` Nathan Neulinger
2017-11-22 16:24         ` Santiago Torres
2017-11-22 20:27         ` Jonathan Nieder
2017-11-22 21:17           ` Jeff King
2017-11-22 21:56             ` Jonathan Nieder
2017-11-22 22:06               ` Jeff King
2017-11-25 21:55                 ` Johannes Schindelin
2017-11-26 19:25                   ` Jeff King
2017-11-26 21:55                     ` Johannes Schindelin
2017-11-27  5:24                       ` Jeff King
2017-11-27  6:03                         ` Junio C Hamano
2017-11-27 20:50                           ` Johannes Schindelin
2017-11-27  6:04                         ` [PATCH] git-status.txt: mention --no-optional-locks Jeff King
2017-11-27  6:07                           ` Junio C Hamano
2017-11-27 10:22                             ` Kaartic Sivaraam
2017-11-27 20:54                               ` Johannes Schindelin
2017-11-27 20:44                         ` git status always modifies index? Johannes Schindelin
2017-11-27 20:49                           ` Jonathan Nieder
2017-11-26  3:32                 ` Junio C Hamano
2017-11-26  9:35                   ` Junio C Hamano [this message]
2017-11-27  4:43                     ` Jeff King
2017-11-27  4:56                       ` Junio C Hamano
2017-11-27  5:00                         ` Jeff King
2017-11-27 20:57                       ` Jonathan Nieder
2017-11-27 22:50                         ` Jeff King
2017-12-03  0:37                         ` Junio C Hamano
2017-11-26 19:27                   ` Jeff King
2017-11-27  0:47                     ` Junio C Hamano
2017-11-27  6:12                       ` Jeff King

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=xmqq7eudidqb.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=jrnieder@gmail.com \
    --cc=nneul@neulinger.org \
    --cc=peff@peff.net \
    --cc=santiago@nyu.edu \
    /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).