git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [JGIT PATCH] Added forward slash to head/remote/tag prefix Constants

From
Shawn O. Pearce <spearce@spearce.org>
Date
Aug 22, 2008, 16:53 UTC
Message-ID
<20080822165327.GL3483@spearce.org>
In-Reply-To
<1219352122-5865-1-git-send-email-charleso@charleso.org>
Charles O'Farrell <charleso@charleso.org> wrote:
> eg. Constants.HEADS_PREFIX + "/" ==> Constants.R_HEADS
> 
> This was always done by every instance anyway and so this will ensure
> it isn't forgotten again.
Thanks, applied.  I had to hand-merge a few sections due to Marek's
push UI going in before your patch, but your patch not having the
necessary changes.  Using a different constant name helped make
that resolution less painful.
 
Show 16 quoted lines
> --- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/TextBuiltin.java
> +++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/TextBuiltin.java
> @@ -184,12 +181,12 @@ protected static String abbreviateObject(final ObjectId id) {
>  	}
>  
>  	protected String abbreviateRef(String dst, boolean abbreviateRemote) {
> -		if (dst.startsWith(REFS_HEADS))
> -			dst = dst.substring(REFS_HEADS.length());
> -		else if (dst.startsWith(REFS_TAGS))
> -			dst = dst.substring(REFS_TAGS.length());
> -		else if (abbreviateRemote && dst.startsWith(REFS_REMOTES))
> -			dst = dst.substring(REFS_REMOTES.length());
> +		if (dst.startsWith(R_HEADS))
> +			dst = dst.substring(R_HEADS.length());
> +		else if (dst.startsWith(R_TAGS))
> +			dst = dst.substring(R_HEADS.length());
This should be R_TAGS. I fixed it when I applied the patch.
-- 
Shawn.
Previous: Charles O'Farrell
Message 2 of 2 in “Added forward slash to head/remote/tag prefix Constants”
  1. Added forward slash to head/remote/tag prefix ConstantsCharles O'Farrell, Aug 21, 2008
  2. Shawn O. PearceAug 22, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.