git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git stash deletes/drops changes of

From
SBStephen Bash <bash@genarts.com>
Date
May 24, 2013, 14:26 UTC
Message-ID
<360187633.973068.1369405562399.JavaMail.root@genarts.com>
In-Reply-To
<87obc15mq5.fsf@linux-k42r.v.cablecom.net>
----- Original Message -----
Show 35 quoted lines
> From: "Thomas Rast" <trast@inf.ethz.ch>
> Sent: Thursday, May 23, 2013 6:56:50 PM
> Subject: Re: git stash deletes/drops changes of
> 
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > Thomas Rast <trast@inf.ethz.ch> writes:
> >
> > > So maybe it would be time to first make up our minds as to what
> > > --assume-unchanged should actually mean:
> > >
> > > * Ignore changes to a tracked file, but treat them as valuable.
> > >   In this case we'd have to make sure that failures like
> > >   git-stash's are handled properly.
> > >
> > > * Ignore changes to a tracked file, as in "who cares if it was
> > >   changed".
> > >
> > > * A very specific optimization for users who know what they are
> > >   doing.
> >
> > It has always been a promise the user makes to Git that the working
> > tree files that are marked as such will be kept identical to what is
> > in the index (hence there is no need for Git to check if they were
> > modified). And by extension, Git is now free to choose reading from
> > the working tree file when asked to read from blob object recorded
> > in the index for that path, or vice versa, because of that promise.
> >
> > It is not --ignore-changes bit, and has never been.  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.
The web team at my $dayjob has the same problem, and I believe they are also using --assume-unchanged.
This may be slightly too tangential, but a different workflow we experimented with is marking the config file(s) merge=ours in gitattributes on each branch.  Ideally then devs can check in their local settings on their local branches.  Unfortunately, as is probably well known here, the merge attribute is only checked by the low level merge algorithm, so too often settings got bashed incorrectly (only one merge parent changed the file).  Perhaps there are some options in that direction?

Thanks, Stephen

Previous: John KeepingNext: Phil Hord
Message 15 of 20 in “git stash deletes/drops changes of "assume-unchanged" files”
  1. Adeodato SimóJun 4, 2010
  2. Jim GreenleafMay 23, 2013
  3. Thomas RastMay 23, 2013
  4. Junio C HamanoMay 23, 2013
  5. Thomas RastMay 23, 2013
  6. Junio C HamanoMay 23, 2013
  7. Petr BaudisMay 23, 2013
  8. John KeepingMay 24, 2013
  9. Petr BaudisMay 24, 2013
  10. John KeepingMay 24, 2013
  11. Petr BaudisMay 24, 2013
  12. John KeepingMay 24, 2013
  13. Petr BaudisMay 24, 2013
  14. John KeepingMay 24, 2013
  15. Stephen BashMay 24, 2013
  16. Phil HordMay 24, 2013
  17. Jim GreenleafMay 24, 2013
  18. John KeepingMay 24, 2013
  19. Jim GreenleafMay 24, 2013
  20. John KeepingMay 24, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.