From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kelvin White Newsgroups: gmane.emacs.devel Subject: Re: After a git merge and manual correction of a conflict, how do I tell git the conflict is fixed? Date: Wed, 27 May 2015 03:14:12 +0000 Message-ID: References: <20150526223928.GA4675@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113b3744303b39051707a362 X-Trace: ger.gmane.org 1432696544 25552 80.91.229.3 (27 May 2015 03:15:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 May 2015 03:15:44 +0000 (UTC) Cc: Alan Mackenzie , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 27 05:15:30 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YxRoV-0005HW-Bq for ged-emacs-devel@m.gmane.org; Wed, 27 May 2015 05:15:27 +0200 Original-Received: from localhost ([::1]:51648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxRoT-0001iS-Qv for ged-emacs-devel@m.gmane.org; Tue, 26 May 2015 23:15:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxRnc-0001an-G8 for emacs-devel@gnu.org; Tue, 26 May 2015 23:15:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxRnK-0004j2-Aq for emacs-devel@gnu.org; Tue, 26 May 2015 23:14:32 -0400 Original-Received: from mail-qc0-f172.google.com ([209.85.216.172]:34998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxRnJ-0004hN-Vp for emacs-devel@gnu.org; Tue, 26 May 2015 23:14:14 -0400 Original-Received: by qchk10 with SMTP id k10so11328920qch.2 for ; Tue, 26 May 2015 20:14:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=C4/ZiN+4t4HsuRZa6xVZ0YIReAK+IXT6eOkMCZjdJ2c=; b=N1DuIGvUiy1vrrLCDtKbPYmDIJJKIJUpP/fB46n3mG5kpUU7lGRO2L7nUbm2DRLDGn z4wuSi5I3Kp/hXOzNIrGZf+TaIJGAyPfPKcRUBZVNrT8FkxVk2s5TxCzppr7VxY7wR5a hlNYulep4j9eEz+VXss1s6mF6j7NXrlmwlxQoknHc2xS9y3+4IoNHF/XitFYYpAaFpJX d6Fhz/BOmnmYBUzSWq0JmAFlkbCm6DiX+D79K1kQD51+2CWbp1jjofoCLhCWxjO9QW1a 9ZBDkNIxT04eu9dVyaasAerHIRmG+B4CJO1EA9wDMT7Ntue2H9dlN17r37Fe2H8DIeIQ 8ZXw== X-Received: by 10.140.106.101 with SMTP id d92mr36869994qgf.70.1432696453608; Tue, 26 May 2015 20:14:13 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.216.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:186858 Archived-At: --001a113b3744303b39051707a362 Content-Type: text/plain; charset=UTF-8 On Tue, May 26, 2015 at 10:55 PM Kelvin White wrote: > On Tue, May 26, 2015 at 10:40 PM Stefan Monnier > wrote: > >> > Which will have the exact same effects as `git rm --cached ' no? >> >> Not at all. "git rm ..." will remove the file from the repository, >> i.e. it will have an effect for *everyone else*. >> >> >> Stefan >> >> > Forgive me, but I think the confusion here is due to the fact that `git > reset ' will remove it from the curennt index, while `git rm --cache > ' will remove it from the repository completely, while leaving the > current local copy in tact. > In this case, this is exactly what you would want. Why would you want to keep this file in version control for everyone else? Consider this... l3thal@dev ~/src/emacs-dev $ git checkout -b test Switched to a new branch 'test' l3thal@dev ~/src/emacs-dev $ echo "moo" >> test_file l3thal@dev ~/src/emacs-dev $ git status # On branch test # Untracked files: # (use "git add ..." to include in what will be committed) # # test_file nothing added to commit but untracked files present (use "git add" to track) l3thal@dev ~/src/emacs-dev $ git add test_file l3thal@dev ~/src/emacs-dev $ git status # On branch test # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # new file: test_file # l3thal@dev ~/src/emacs-dev $ git commit -m "adding test file" [test dde69ae] adding test file 1 file changed, 2 insertions(+) create mode 100644 test_file l3thal@dev ~/src/emacs-dev $ git status # On branch test nothing to commit, working directory clean l3thal@dev ~/src/emacs-dev $ git rm --cached test_file rm 'test_file' l3thal@dev ~/src/emacs-dev $ git status # On branch test # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # deleted: test_file # # Untracked files: # (use "git add ..." to include in what will be committed) # # test_file l3thal@dev ~/src/emacs-dev $ git commit -am "removing test file" [test 46f7f53] removing test file 1 file changed, 2 deletions(-) delete mode 100644 new_file l3thal@dev ~/src/emacs-dev $ git status # On branch test # Untracked files: # (use "git add ..." to include in what will be committed) # # new_file nothing added to commit but untracked files present (use "git add" to track) This is the same situation as a merge conflict in a file that you dont want to keep in the remote git repo.. You need to remove it from the index and keep it locally. --001a113b3744303b39051707a362 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Tue, May 26, 2015 at= 10:55 PM Kelvin White <kwhite@gnu.org= > wrote:
On Tue, May 26, 2015 at 10:40 PM Stefan Monnier <monnier@iro.umont= real.ca> wrote:
>=C2=A0 Which w= ill have the exact same effects as `git rm --cached <file>' no?
Not at all.=C2=A0 "git rm ..." will remove the file from the repo= sitory,
i.e. it will have an effect for *everyone else*.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan


Forgive me, but I think the confusion here is due to the = fact that `git reset <file>' will remove it from the curennt inde= x, while `git rm --cache <file>' will remove it from the reposito= ry completely, while leaving the current local copy in tact.

In this case, this is exactly what you = would want. Why would you want to keep this file in version control for eve= ryone else? Consider this...

l3thal@dev ~/src= /emacs-dev $ git checkout -b test
Switched to a new branch 't= est'
l3thal@dev ~/src/emacs-dev $ echo "moo" >&g= t; test_file
l3thal@dev ~/src/emacs-dev $ git status
# = On branch test
# Untracked files:
# =C2=A0 (use "g= it add <file>..." to include in what will be committed)
#
# test_file
nothing added to commit but untracked files presen= t (use "git add" to track)
l3thal@dev ~/src/emacs-dev $= git add test_file
l3thal@dev ~/src/emacs-dev $ git status
<= div># On branch test
# Changes to be committed:
# =C2= =A0 (use "git reset HEAD <file>..." to unstage)
#=
# new file: =C2=A0 test_file
#
l3thal@dev ~/src/emacs-d= ev $ git commit -m "adding test file"
[test dde69ae] ad= ding test file
=C2=A01 file changed, 2 insertions(+)
= =C2=A0create mode 100644 test_file
l3thal@dev ~/src/emacs-dev $ g= it status
# On branch test
nothing to commit, working d= irectory clean
l3thal@dev ~/src/emacs-dev $ git rm --cached test_= file
rm 'test_file'
l3thal@dev ~/src/emacs-dev = $ git status
# On branch test
# Changes to be committed= :
# =C2=A0 (use "git reset HEAD <file>..." to uns= tage)
#
# deleted: =C2=A0 =C2=A0test_file
#
# = Untracked files:
# =C2=A0 (use "git add <file>..."= ; to include in what will be committed)
#
# test_file
l= 3thal@dev ~/src/emacs-dev $ git commit -am "removing test file"
[test 46f7f53] removing test file
=C2=A01 file changed, = 2 deletions(-)
=C2=A0delete mode 100644 new_file
l3thal= @dev ~/src/emacs-dev $ git status
# On branch test
# Un= tracked files:
# =C2=A0 (use "git add <file>..." = to include in what will be committed)
#
# new_file
nothi= ng added to commit but untracked files present (use "git add" to = track)

This is the same situation as a merge= conflict in a file that you dont want to keep in the remote git repo.. You= need to remove it from the index and keep it locally.
--001a113b3744303b39051707a362--