Git development
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] get_tree_entry: map blank requested entry to tree root
Date: Tue, 9 Jan 2007 19:46:33 -0500	[thread overview]
Message-ID: <20070110004633.GA14345@coredump.intra.peff.net> (raw)
In-Reply-To: <7vk5zviwxa.fsf@assigned-by-dhcp.cox.net>

On Tue, Jan 09, 2007 at 03:48:33PM -0800, Junio C Hamano wrote:

> Makes sense, although I somewhat worry about changing the
> behaviour and potentially breaking the expectation of callers
> of get_tree_entry() other than "git show".

Previously, trying to get an empty name would always return -1. Most of
the users besides sha1_name are getting the paths by enumerating the
index or an existing tree, so they will never be blank. The exceptions
are:
 - git-blame ''; this fails in both the root and a subdir (though with
   different errors); behavior is unchanged with my patch
 - git-archive feeds the 'prefix' variable to get_tree_entry; it works
   fine in the root with or without the patch. I seem to be getting an
   error, with or without my patch, when doing a git-archive from a
   subdirectory:
     $ git-archive --format=tar origin >/dev/null
     $ cd Documentation
     $ git-archive --format=tar origin >/dev/null
     fatal: cannot read c87c61af00c6d2cd7212240e260809000000aaab
   but I haven't been able to track it down further. It's clearly
   unrelated to my patch, though.

The main difference is that looking up a ref through sha1_name used to
fail to match 'HEAD:'; now it does. So if you were trying to match a
file 'HEAD:' without using '--', you're out of luck.

-Peff

  reply	other threads:[~2007-01-10  0:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-09 16:11 [PATCH] get_tree_entry: map blank requested entry to tree root Jeff King
2007-01-09 16:15 ` Johannes Schindelin
2007-01-09 23:48 ` Junio C Hamano
2007-01-10  0:46   ` Jeff King [this message]
2007-01-10  0:57     ` Junio C Hamano
2007-01-10  0:57       ` Jeff King
2007-01-10  1:04         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070110004633.GA14345@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox