From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: C-x v u for added files in vc-git Date: Thu, 3 Dec 2009 21:44:31 -0800 (PST) Message-ID: <200912040544.nB45iVB3002714@godzilla.ics.uci.edu> References: <200912030606.nB366cKS021507@godzilla.ics.uci.edu> <20091203090205.8k74zmgqe8ko8k8o@webmail.mnet-online.de> <200912030909.nB3993lF022865@godzilla.ics.uci.edu> <20091203131514.cq73r2k3cwso8sow@webmail.mnet-online.de> <200912031822.nB3IMZt0027156@godzilla.ics.uci.edu> <200912040449.nB44n3hn002309@godzilla.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1259905683 2262 80.91.229.12 (4 Dec 2009 05:48:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Dec 2009 05:48:03 +0000 (UTC) Cc: mathias@mnet-mail.de, emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 04 06:47:56 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NGR1G-0000PG-J7 for ged-emacs-devel@m.gmane.org; Fri, 04 Dec 2009 06:47:54 +0100 Original-Received: from localhost ([127.0.0.1]:48640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGR1G-0003fJ-9s for ged-emacs-devel@m.gmane.org; Fri, 04 Dec 2009 00:47:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGR18-0003eU-KI for emacs-devel@gnu.org; Fri, 04 Dec 2009 00:47:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGR12-0003Zw-7G for emacs-devel@gnu.org; Fri, 04 Dec 2009 00:47:44 -0500 Original-Received: from [199.232.76.173] (port=38398 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGR11-0003Zt-UL for emacs-devel@gnu.org; Fri, 04 Dec 2009 00:47:39 -0500 Original-Received: from paul-mcgann-v0.ics.uci.edu ([128.195.1.147]:45324) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NGR10-0002K9-Ff; Fri, 04 Dec 2009 00:47:38 -0500 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by paul-mcgann-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id nB45iVWE021097 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 3 Dec 2009 21:44:31 -0800 Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id nB45iVB3002714; Thu, 3 Dec 2009 21:44:31 -0800 (PST) In-Reply-To: (Miles Bader's message of "Fri, 04 Dec 2009 14:24:30 +0900") Original-Lines: 31 X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: nB45iVWE021097 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0.561, required 5, autolearn=disabled, ALL_TRUSTED -1.44, GAPPY_SUBJECT 2.00) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:118237 Archived-At: Miles Bader writes: > Dan Nicolaescu writes: > > > > git checkout HEAD > > > > git rm --cached > > > > > > > > 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?