All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Thomas Rast <trast@inf.ethz.ch>
Cc: Jim Greenleaf <james.a.greenleaf@gmail.com>,
	<git@vger.kernel.org>, "Petr Baudis" <pasky@ucw.cz>
Subject: Re: git stash deletes/drops changes of
Date: Thu, 23 May 2013 16:20:27 -0700	[thread overview]
Message-ID: <7v4ndtcmh0.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <87obc15mq5.fsf@linux-k42r.v.cablecom.net> (Thomas Rast's message of "Fri, 24 May 2013 00:56:50 +0200")

Thomas Rast <trast@inf.ethz.ch> writes:

>> What are the workflows that are helped if we had such a bit?  If
>> we need to support them, I think you need a real --ignore-changes
>> bit, not an abuse of --assume-unchanged.
>
> I gather -- from #git -- that it's mostly used for config files, which
> have an annoying habit of being different from the repository.
>
> Which is wrong, really.  But we still claim that --assume-unchanged is a
> solution to it in git-update-index(1).

That is doubly wrong, then ;-)

How would we want to proceed from here?  The obvious first step
would be to fix the documentation, but then what is next?

Thinking aloud, ignoring that "Which is wrong, really" part in your
message and assuming that we do want to support --ignore-changes....

Can the way we handle "--ignore-changes" files be a strict superset
(or is it subset?) of what we currently do for "--assume-unchanged"?
That is, if we "fix"^Wchange the behaviour of "--assume-unchanged"
to be less aggressive in assuming that the user kept his promise,
can we get "--ignore-changes" without losing much of the performance
benefit of "--assume-unchanged" the people who originally wanted to
have that feature have enjoyed for all these years?

If you are working on a project with a large working tree, by
marking paths in one directory you do not care about (and do not
use) with the --assume-unchanged bit, checking out another branch
can be done without inspecting if there are uncommitted changes in
the part of the working tree that may be clobbered with the
different version of the file in the other branch.  That has to go
for "--ignore-changes", for example.  Are there others that need to
suffer?

If so, these two have to be done as totally independent options, but
if -ignore-changes can be just a slightly less agressive
-assume-unchanged, we could "fix" "--assume-unchanged", introduce
"--ignore-changes" as a synonym and be done with it.  I highly doubt
that is doable.

The only sensible way forward, it seems to me, is introduce a proper
"--ignore-changes" that is independent from "--assume-unchanged".
What does "--ignore-changes" really mean?

The end user does not want to see changes to a config file when he
runs "git status" and "git diff".  I think "git commit -a" would
ignore the local changes to the configuration file as a natural
consequence if we teach "git status" to ignore paths marked with the
"--ignore-changes" bit.  But the same "git diff" (between the index
and the working tree) logic is internally used to decide if a path
has local changes when running "git checkout" to check out another
branch, "git rebase" to see if there are local changes, etc. and the
user do want to view the paths as modified.

I am not so sure if there is a clear semantics other than
an unactionable blanket statement "ignore local changes".

  reply	other threads:[~2013-05-23 23:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-04 16:24 git stash deletes/drops changes of "assume-unchanged" files Adeodato Simó
2013-05-23 16:57 ` git stash deletes/drops changes of Jim Greenleaf
2013-05-23 22:10   ` Thomas Rast
2013-05-23 22:49     ` Junio C Hamano
2013-05-23 22:56       ` Thomas Rast
2013-05-23 23:20         ` Junio C Hamano [this message]
2013-05-24 15:25           ` Phil Hord
2013-05-24 15:34             ` Jim Greenleaf
2013-05-24 15:38               ` John Keeping
2013-05-24 15:42                 ` Jim Greenleaf
2013-05-24 16:01                   ` John Keeping
2013-05-23 23:57         ` Petr Baudis
2013-05-24  8:22           ` John Keeping
2013-05-24  9:40             ` Petr Baudis
2013-05-24 10:06               ` John Keeping
2013-05-24 10:14                 ` Petr Baudis
2013-05-24 10:40                   ` John Keeping
2013-05-24 11:03                     ` Petr Baudis
2013-05-24 12:42                       ` John Keeping
2013-05-24 14:26         ` Stephen Bash

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=7v4ndtcmh0.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=james.a.greenleaf@gmail.com \
    --cc=pasky@ucw.cz \
    --cc=trast@inf.ethz.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.
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.