From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: Obscure error/warning/information message from git pull Date: Wed, 19 Nov 2014 08:12:38 +0700 Message-ID: References: <20141114180521.GA3168@acm.acm> <20141114230235.GF3168@acm.acm> <20141117141123.GA4294@acm.acm> <83lhn89zxn.fsf@gnu.org> <83bno49xtw.fsf@gnu.org> <20141118224326.GA5167@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1416359582 11865 80.91.229.3 (19 Nov 2014 01:13:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Nov 2014 01:13:02 +0000 (UTC) Cc: Sergey Organov , Emacs developers To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 19 02:12:55 2014 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 1XqtpH-0002Ed-3r for ged-emacs-devel@m.gmane.org; Wed, 19 Nov 2014 02:12:55 +0100 Original-Received: from localhost ([::1]:56085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqtpG-0005vA-8O for ged-emacs-devel@m.gmane.org; Tue, 18 Nov 2014 20:12:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xqtp3-0005v3-Jz for emacs-devel@gnu.org; Tue, 18 Nov 2014 20:12:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xqtp1-0000Nu-G3 for emacs-devel@gnu.org; Tue, 18 Nov 2014 20:12:41 -0500 Original-Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]:45055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xqtp1-0000No-BQ for emacs-devel@gnu.org; Tue, 18 Nov 2014 20:12:39 -0500 Original-Received: by mail-oi0-f51.google.com with SMTP id e131so4635193oig.38 for ; Tue, 18 Nov 2014 17:12:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=V0r80YYLiTYk30guYmIelwdARRTe/zryRcMSJw7vDKk=; b=oNDMQyM/4UHbYoSt7wriyy5HGLrO0GzpbC5lzj7CR7pnTVrXuHt4HULUwoemyhf0NC 1onEComc1DV+6XWG3Hzyfrw0t0ybpfatPJnwOB5/XxEK7ukovIcFWl9Bd3W5PSZl3ziV lkTwti6a1PCilNvm4HcnQg3KNMQ6x1aCHCqpENt4nv26Fybml2YtXlUINrJXsyqZQ2pK UZY3mowP6bUGsL4y1Bv/apma3OnONYCRSZwwRoIVqvKrOhzmHoB6cCGEgKiTJK0km7mb ygVPWJz6eITykr+kdPI8X8UPRrSARA6cIpUy76r2OO0Sb9R+vwT3oUrsSg1TjLtFLz5g +KVA== X-Received: by 10.202.172.5 with SMTP id v5mr12149495oie.48.1416359558568; Tue, 18 Nov 2014 17:12:38 -0800 (PST) Original-Received: by 10.76.13.196 with HTTP; Tue, 18 Nov 2014 17:12:38 -0800 (PST) In-Reply-To: <20141118224326.GA5167@acm.acm> X-Google-Sender-Auth: 33aKusqVMwPk_MhRtApP_fB-cWw X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c06::233 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:177699 Archived-At: On Wed, Nov 19, 2014 at 4:43 AM, Alan Mackenzie wrote: > >> Well, given the following history (time goes from left to right): > >> - C - D <- foo >> / >> ... - A - B >> \ >> - E - F <- bar > > >> what branch commit A was made on, 'foo' or 'bar'? > > Quite clearly, A was committed on branch foo, since bar didn't exist at > that time. But git does not know that. For all it knows, bar could be the original branch and foo branched from it at B. The history above is symmetrical. > Are you saying that at B, when bar is branched from foo, git discards > all information about this branching, remembering only that there are two > branches which are henceforth of fully equal status where before there > was just one? There *is* no information to discard. Heads are completely separate from the DAG, a thin convenience layer over it, an /etc/hosts analog for SHA1 hashes. Head names are arbitrary and can be changed at any time. Indeed, it is a common thing for me to start development on master and make a few commits: $ git checkout master $ hack; git commit $ hack; git commit $ hack; git commit $ hack; git commit o---o---o---o *master* / ---o---o origin/master Oops, it=E2=80=99s going out of control and I will possibly need a couple d= ays more and I envision a prettifying rebase down the road. Let=E2=80=99s make = it a feature branch. $ git branch feature o---o---o---o feature, *master* / ---o---o origin/master Put master where it belongs: $ git reset --hard origin/master o---o---o---o feature / ---o---o origin/master, *master* Now continue work: $ git checkout feature $ hack; git commit o---o---o---o---o *feature* / ---o---o origin/master, master If git remembered the branch name with each commit, that retroactive branching would not be possible. (Nitpicker=E2=80=99s corner: Some will say such workflows are sloppy and a = bad practice and one should always start work on a feature branch, even if the feature is a one-liner, and then merge it to master with a --no-ff. They are missing the point. Git *allows* us to be sloppy and correct mistakes afterwards, rather than require constant vigilance.)