git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <junkio@cox.net>, Git Mailing List <git@vger.kernel.org>
Subject: Re: Make ref resolution saner
Date: Tue, 12 Sep 2006 07:41:19 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0609120739310.27779@g5.osdl.org> (raw)
In-Reply-To: <20060912053616.GA6706@coredump.intra.peff.net>



On Tue, 12 Sep 2006, Jeff King wrote:
> 
> I assume your patch is against master;

Yeah. Well, master plus my previous patches.

> it looks like there's exactly one call to resolve_ref that's in next but 
> not master. One-liner fix below.

Not quite enough. It's the same thing: wt-status.c plays games with the 
return value (which _used_ to be a path) in order to turn it back into a 
ref. But now that it's all about refs, the games are unnecessary:

> diff --git a/wt-status.c b/wt-status.c
> index ec2c728..e2f49c7 100644
> --- a/wt-status.c
> +++ b/wt-status.c
> @@ -41,7 +41,7 @@ void wt_status_prepare(struct wt_status 
>  
>  	s->is_initial = get_sha1("HEAD", sha1) ? 1 : 0;
>  
> -	head = resolve_ref(git_path("HEAD"), sha1, 0);
> +	head = resolve_ref("HEAD", sha1, 0);
>  	s->branch = head ?
>  		    strdup(head + strlen(get_git_dir()) + 1) :
>  		    NULL;

So that "strdup(head + strlen(get_git_dir()) + 1)" should now be just 
"strdup(head)".

		Linus

  reply	other threads:[~2006-09-12 14:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-11 19:03 Allow multiple "git_path()" uses Linus Torvalds
2006-09-11 23:37 ` Start handling references internally as a sorted in-memory list Linus Torvalds
2006-09-11 23:50   ` Linus Torvalds
2006-09-11 23:57   ` Junio C Hamano
2006-09-12  1:05     ` Linus Torvalds
2006-09-12  1:09   ` Chris Wedgwood
2006-09-12  3:10   ` Add support for negative refs Linus Torvalds
2006-09-12  3:17     ` Make ref resolution saner Linus Torvalds
2006-09-12  5:36       ` Jeff King
2006-09-12 14:41         ` Linus Torvalds [this message]
2006-09-18  7:25   ` [RFC] git-pack-refs --prune Junio C Hamano
2006-09-18 16:47     ` Linus Torvalds
2006-09-18 18:44       ` Junio C Hamano
2006-09-21  7:02       ` Junio C Hamano
2006-09-21  7:06         ` [PATCH 1/5] symbolit-ref: fix resolve_ref conversion Junio C Hamano
2006-09-21  7:06         ` [PATCH 2/5] Add callback data to for_each_ref() family Junio C Hamano
2006-09-21  7:06         ` [PATCH 3/5] Tell between packed, unpacked and symbolic refs Junio C Hamano
2006-09-21  7:06         ` [PATCH 4/5] pack-refs: do not pack " Junio C Hamano
2006-09-21  7:06         ` [PATCH 5/5] git-pack-refs --prune Junio C Hamano
2006-09-21 15:19         ` [RFC] " Linus Torvalds
2006-09-22  4:57           ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2006-09-12 18:57 Make ref resolution saner linux

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=Pine.LNX.4.64.0609120739310.27779@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=peff@peff.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;
as well as URLs for NNTP newsgroup(s).