[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C-x v u for added files in vc-git
From: |
Dan Nicolaescu |
Subject: |
Re: C-x v u for added files in vc-git |
Date: |
Thu, 3 Dec 2009 21:44:31 -0800 (PST) |
Miles Bader <address@hidden> writes:
> Dan Nicolaescu <address@hidden> writes:
> > > > git checkout HEAD <file>
> > > > git rm --cached <file>
> > > >
> > > > that take care of all situations.
> > >
> > > I don't know _what_ people expect "C-x v u" to do for files that were
> > > never committed, .... but the above sequence (specifically, the "git
co")
> > > seems to reset the file's contents to the contents it had at the time
it
> > > was added with "git add", in addition to removing it from the list of
> > > added files.
> >
> > That's not good, we need something that just removes it from the index
> > and keeps the current contents.
>
> Hmm, that sequence also seems wrong in that the "git rm --cached" will
> make previously committed files become "deleted" in the tree.
>
> It seems like it's necessary to test whether a file has already been
> committed, and use "git co" if so, and otherwise use "git rm --cached".
>
> Since VC already appears to know whether the file's in the repo or just
> "added" (in the mode-line, it shows "@" for newly added files, but ":"
> or "-" for already-in-the-repo files), that should be possible, right?
It should be.
BTW, can't
git reset FILE
be used here?
- C-x v u for added files in vc-git, Dan Nicolaescu, 2009/12/03
- Re: C-x v u for added files in vc-git, mathias, 2009/12/03
- Re: C-x v u for added files in vc-git, Dan Nicolaescu, 2009/12/03
- Re: C-x v u for added files in vc-git, mathias, 2009/12/03
- Re: C-x v u for added files in vc-git, Dan Nicolaescu, 2009/12/03
- Re: C-x v u for added files in vc-git, Miles Bader, 2009/12/03
- Re: C-x v u for added files in vc-git, Dan Nicolaescu, 2009/12/03
- Re: C-x v u for added files in vc-git, Miles Bader, 2009/12/04
- Re: C-x v u for added files in vc-git,
Dan Nicolaescu <=
- Re: C-x v u for added files in vc-git, Miles Bader, 2009/12/04
- Re: C-x v u for added files in vc-git, Dan Nicolaescu, 2009/12/04