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

Re: how to revert changes in working tree?

From
Alex Riesen <raa.lkml@gmail.com>
Date
Dec 6, 2006, 12:30 UTC
Message-ID
<81b0412b0612060430u2124a4c8v4f0dc2de65e722fb@mail.gmail.com>
In-Reply-To
<4576A60A.3060003@gmail.com>
On 12/6/06, Liu Yubao <yubao.liu@gmail.com> wrote:
Show 27 quoted lines
> >> > They problem is the exec-bit which windows does not
> >> > have and cygwin failed to correctly workaround the
> >> > limitation.
> >> >
> >> > Do a "git repo-config core.filemode false" to almost
> >> > disable the checks for exec bit.
> >> >
> >>
> >> It has been set. I guess the cause is a interrupted merge
> >> operation that leads to textual difference.
> >
> > yes, though what I can't understand is why don't you have
> > unmerged entries... Maybe it comes from playing with
> > all these commands you mentioned in the original mail.
> >
> >> After run "git reset --hard", all deleted files come back, but I reach
> >> the old state:
> >> $ git status
> >
> > When? Immediately after git reset --hard? Then you very
> > likely have no permission to write (or lost it somehow) into
> > the working directory, otherwise I don't see could this be
> > possible. git reset --hard rewrites everything.
> >
> Yes, immediately after git reset --hard. I'm sure I have write
> permission because all deleted files come back and no "permission
> denied" like message appears.

Maybe you have the files open in some editor? Otherwise something is broken. Could you try current git (I mean something like ba988a83f0cfdafdcfdc7ed44253840ea83578fb?

> I will try to run git in debugger, wish I can get the reason.

don't think It'd be as simple as step-by-step in debugger. Try to instrument builtin-read-tree.c or unpack-trees.c and see if it actually updates the files...

> $ git merge "sync from origin" HEAD origin
> Updating 088406b..ff51a98
just for fun, what does following print:
  git read-tree --reset -u HEAD && git update-index --refresh
Previous: Liu YubaoNext: Jakub Narebski
Message 6 of 11 in “how to revert changes in working tree?”
  1. Liu YubaoDec 6, 2006
  2. Alex RiesenDec 6, 2006
  3. Liu YubaoDec 6, 2006
  4. Alex RiesenDec 6, 2006
  5. Liu YubaoDec 6, 2006
  6. Alex RiesenDec 6, 2006
  7. Jakub NarebskiDec 6, 2006
  8. Shawn PearceDec 6, 2006
  9. Liu YubaoDec 7, 2006
  10. Juergen RuehleDec 7, 2006
  11. Jakub NarebskiDec 6, 2006

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.