From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26793 invoked by alias); 1 Jun 2014 12:40:08 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32649 Received: (qmail 13871 invoked from network); 1 Jun 2014 12:40:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 Date: Sun, 1 Jun 2014 08:33:02 -0400 From: Aaron Schrab To: Daniel Shahaf Cc: zsh-workers@zsh.org Subject: Re: vcs_info git: Fix stagedstr for empty repos Message-ID: <20140601123302.GA26511@pug.qqx.org> Mail-Followup-To: Daniel Shahaf , zsh-workers@zsh.org References: <20140601022653.GE1820@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20140601022653.GE1820@tarsus.local2> User-Agent: Mutt/1.5.22+67 (g5875feb) (2013-10-16) At 02:26 +0000 01 Jun 2014, Daniel Shahaf wrote: >'diff-index --cached --quiet $empty_tree' is an O(1) operation, but I >am not sure whether it is forwards compatible with future versions of >Git, i.e., whether it's a hack that happens to work or a legitimate use >of git's API. git itself does that comparison in several places, including in the sample pre-commit hook that is shipped with it. So I'd say that that behavior is highly unlikely to change. Many of those places, including that sample hook actually hard-code the sha1 for the empty tree as 4b825dc642cb6eb9a060e54bf8d69288fbee4904.