git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Parkins <andyparkins@gmail.com>
To: git@vger.kernel.org
Subject: Re: confusion over the new branch and merge config
Date: Fri, 22 Dec 2006 08:31:25 +0000	[thread overview]
Message-ID: <200612220831.26497.andyparkins@gmail.com> (raw)
In-Reply-To: <7vvek492q1.fsf@assigned-by-dhcp.cox.net>

On Friday 2006 December 22 00:46, Junio C Hamano wrote:

> You can always say "git log refs/heads/next" even though you are
> allowed to say "git log next".  Maybe we should remove that
> shorthand to make it consistent?   I think not.

On a related subject - I'd like to remove all the "refs/" literals from git.  
All refs are always under "refs/", so prefixing everything with refs/ is just 
noise.

The place that makes it stand out that this is wrong is (I think) found in 
refs.c (excuse my abuse of syntax):

int for_each_ref(each_ref_fn fn, void *cb_data)
    return do_for_each_ref("refs/", fn, 0, cb_data);
int for_each_tag_ref(each_ref_fn fn, void *cb_data)
    return do_for_each_ref("refs/tags/", fn, 10, cb_data);
int for_each_branch_ref(each_ref_fn fn, void *cb_data)
    return do_for_each_ref("refs/heads/", fn, 11, cb_data);
int for_each_remote_ref(each_ref_fn fn, void *cb_data)
    return do_for_each_ref("refs/remotes/", fn, 13, cb_data);

What's significant is that it is only for_each_ref() that hands the prefix 
back.  The change I'd like to make is 
    return do_for_each_ref("refs/", fn, 5, cb_data);

Obviously, this will imply a lot of changes everywhere else; so I didn't want 
to dive into it without mentioning it here first.

Is this a sensible thing to want to do?  

As I'm talking about code cleanups, I'd also like to change all variables 
called "sha1" to "hash" (or similar).  The point being that the variables 
hold hashes not sha1's.

I don't say that the above are serious problems, I just like cleaning code :-)


Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com

  parent reply	other threads:[~2006-12-22  8:31 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-21 22:17 confusion over the new branch and merge config Nicolas Pitre
2006-12-21 23:01 ` Junio C Hamano
2006-12-21 23:21   ` Sean
2006-12-22  0:39     ` Junio C Hamano
2006-12-22  0:46     ` Junio C Hamano
2006-12-22  1:01       ` Sean
2006-12-22  8:31       ` Andy Parkins [this message]
2006-12-22  7:50   ` Alan Chandler
2006-12-22  8:21     ` Junio C Hamano
2006-12-22  8:39       ` Andy Parkins
2006-12-22 15:25         ` Alan Chandler
2006-12-22 20:49   ` Nicolas Pitre
2006-12-22 21:04     ` Jakub Narebski
2006-12-22 21:20       ` Nicolas Pitre
2006-12-22 22:40         ` Jakub Narebski
2006-12-22 23:39     ` Junio C Hamano
2006-12-23  3:10       ` Tom Prince
2006-12-23  5:11       ` Nicolas Pitre
2006-12-23  5:12   ` Jeff King
2006-12-23  5:29     ` Nicolas Pitre
2006-12-23  6:15     ` Junio C Hamano
2006-12-23  6:22       ` Shawn Pearce
2006-12-23  6:28       ` Jeff King
2006-12-23  7:11         ` Junio C Hamano
2006-12-23  7:25           ` Jeff King
2006-12-23  9:51       ` Junio C Hamano
2006-12-23 10:40         ` Jakub Narebski
2006-12-23 15:58         ` Johannes Schindelin
2006-12-23 22:48           ` Jakub Narebski
2006-12-24  6:15         ` Jeff King
2006-12-24 20:49         ` Nicolas Pitre
2006-12-26  7:33           ` Jeff King
2007-01-02 14:49         ` Jeff King
2007-01-02 17:32           ` Junio C Hamano
2007-01-02 17:34             ` Jeff King
2007-01-02 20:04               ` Junio C Hamano
2007-01-02 20:30                 ` Jakub Narebski
2007-01-03  0:24                   ` Santi Béjar
2007-01-03 23:02                     ` Jakub Narebski
2007-01-09 15:05                 ` Jeff King
2007-01-09 16:18                   ` Jeff King
2006-12-23  8:31     ` Jakub Narebski
2006-12-22  8:41 ` Andy Parkins
2006-12-22  9:39   ` Lars Hjemli
2006-12-22 15:10     ` Nicolas Pitre

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=200612220831.26497.andyparkins@gmail.com \
    --to=andyparkins@gmail.com \
    --cc=git@vger.kernel.org \
    /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).