From: John Keeping <john@keeping.me.uk>
To: Jim Greenleaf <james.a.greenleaf@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git stash deletes/drops changes of
Date: Fri, 24 May 2013 17:01:43 +0100 [thread overview]
Message-ID: <20130524160143.GF27005@serenity.lan> (raw)
In-Reply-To: <loom.20130524T174015-773@post.gmane.org>
On Fri, May 24, 2013 at 03:42:37PM +0000, Jim Greenleaf wrote:
> John Keeping <john <at> keeping.me.uk> writes:
>
> > I wonder if this would be better as a file rather than another option to
> > git-update-index. We already have .git/info/exclude so we could add
> > .git/info/freeze or .git/info/local with the same syntax as the normal
> > .gitignore file.
>
> .git/info/freeze would be a good solution.
> It would avoid the need to add a new class of files for git-status,
> while keeping a simple, familiar record of all frozen files in a single location.
Now I've thought about it a bit more, I'm not sure this does work.
If an entry in the freeze list means "ignore local changes in this
file", we really want to be talking about local changes relative to some
base. Otherwise, what happens if the upstream file is radically
altered? A user probably doesn't want to keep their file unchanged when
this happens.
So we don't just want to store the filename, we want to store the
version of the file that the user chose to ignore. One way to do this
might be to mark the file as a conflict whenever a change to it comes in
and ignore the freeze file when there is a conflict in the index. But
then we either need to introduce a new command to manage this state or
some way for the user to perform Git operations ignoring the freeze
file, otherwise how can the user pull down updates?
Perhaps a more user-friendly way to handle this would be to introduce
auto-stash around any operation that will modify a frozen file. So we
stash the user's (frozen) changes and then apply them after changing the
file. If there are conflicts then these are marked in the index and
must be resolved, then the unstaged changes in the file are ignored
again.
next prev parent reply other threads:[~2013-05-24 16:02 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
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 [this message]
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=20130524160143.GF27005@serenity.lan \
--to=john@keeping.me.uk \
--cc=git@vger.kernel.org \
--cc=james.a.greenleaf@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.
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 NNTP newsgroup(s).