From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: VC mode and git Date: Fri, 27 Mar 2015 10:35:46 +0300 Message-ID: <83egoanb8t.fsf@gnu.org> References: <20150324163714.GA27775@thyrsus.com> <83y4mmpb1n.fsf@gnu.org> <87lhim9sqp.fsf@igel.home> <87egoc56qg.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1427441798 28860 80.91.229.3 (27 Mar 2015 07:36:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Mar 2015 07:36:38 +0000 (UTC) Cc: esr@thyrsus.com, emacs-devel@gnu.org, schwab@linux-m68k.org, tsdh@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 27 08:36:23 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 1YbOoM-0002JR-W9 for ged-emacs-devel@m.gmane.org; Fri, 27 Mar 2015 08:36:11 +0100 Original-Received: from localhost ([::1]:48354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbOoM-0006aA-4J for ged-emacs-devel@m.gmane.org; Fri, 27 Mar 2015 03:36:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbOo5-0006T5-Rw for emacs-devel@gnu.org; Fri, 27 Mar 2015 03:35:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbOo2-0001nz-DF for emacs-devel@gnu.org; Fri, 27 Mar 2015 03:35:53 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:59221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbOo2-0001nN-5r; Fri, 27 Mar 2015 03:35:50 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NLV001000REID00@a-mtaout21.012.net.il>; Fri, 27 Mar 2015 10:35:48 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NLV001LA13OH650@a-mtaout21.012.net.il>; Fri, 27 Mar 2015 10:35:48 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 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:184365 Archived-At: > Date: Thu, 26 Mar 2015 23:09:04 -0400 > From: Richard Stallman > Cc: esr@thyrsus.com, eliz@gnu.org, schwab@linux-m68k.org, emacs-devel@gnu.org > > > Just to elaborate: neither vc-bzr nor vc-git nor vc-hg (the DVCS > > interfaces) push on commit but our advertised bzr setup made bzr itself > > push on commit by default (because it was a bound branch). > > If Git has no feature comparable to a bound branch, that seems like a defect > compared with Bzr. Personally, I agree, but the majority out there don't. Until a motivated individual steps forward and adds this to Git, I don't think we can hope to have such a feature. > Perhaps we should supply that feature. You mean, in Emacs? I don't think we can. The commit in a bound branch was committing and pushing atomically, and I don't see how can you do that by calling two separate Git commands. > > In the same way, you could set up a git post-commit hook that pushes if > > you wish by placing a scipt with contents > > > --8<---------------cut here---------------start------------->8--- > > #!/bin/sh > > git push > > --8<---------------cut here---------------end--------------->8--- > > > in .git/hooks/post-commit/. > > That recommendation is rather cumbersome compared to our former > recommendations for Bzr, but that change would be a step up > in our Git recommendations for people starting with Git. I don't recommend it, certainly not with this script, for 2 reasons: . using the script, the commit+push are not an atomic operation, so the commit could succeed, but the following push could fail, leaving your repository out of sync . it will be hard (or even impossible) to do a local commit without pushing, because the hook will always be run; you need the local commit for when you merge and resolve conflicts and in other situations So, unless someone comes with a smarter hook script that overcomes the above deficiencies, I strongly recommend against using it.