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

Re: [PATCH 2/6] add get_sha1_with_real_ref() returning full name of ref on demand

From
Steffen Prohaska <prohaska@zib.de>
Date
Oct 14, 2007, 21:37 UTC
Message-ID
<5F1A8BAA-108D-4D55-9AEE-7ECDFA3DEB03@zib.de>
In-Reply-To
<Pine.LNX.4.64.0710141819490.25221@racer.site>
On Oct 14, 2007, at 7:21 PM, Johannes Schindelin wrote:
Show 18 quoted lines
> Hi,
>
> On Sun, 14 Oct 2007, Steffen Prohaska wrote:
>
>> Deep inside get_sha1() the name of the requested ref is matched
>> according to the rules documented in git-rev-parse. This patch
>> introduces a function that returns the full name of the matched
>> ref to the outside.
>>
>> For example 'master' is typically returned as 'refs/heads/master'.
>>
>> The new function can be used by "git rev-parse" to print the full
>> name of the matched ref and can be used by "git send-pack" to expand
>> a local ref to its full name.
>
> I have not really studies your patch, but from your description it  
> sounds
> as if dwim_ref() does what you want.

Without my patch get_sha1_with_mode() calls get_sha1_1() calls get_sha1_basic() calls dwim_ref(). I didn't analyze in detail what the *sha1* functions add to what dwim_ref() provides.

The patch passes the information from dwim_ref() up the callstack. Maybe this is not needed and I could directly call dwim_ref(). But I don't know.

	Steffen
Previous: Johannes SchindelinNext: Steffen Prohaska
Message 10 of 12 in “change push's refspec behavior to match rev-parse”
  1. Steffen ProhaskaOct 14, 2007
  2. 1/6 push, send-pack: fix test if remote branch exists for colon-less refspecSteffen Prohaska, Oct 14, 2007
  3. 2/6 add get_sha1_with_real_ref() returning full name of ref on demandSteffen Prohaska, Oct 14, 2007
  4. 3/6 rev-parse: teach "git rev-parse --symbolic" to print the full ref nameSteffen Prohaska, Oct 14, 2007
  5. 4/6 push, send-pack: support pushing HEAD to real ref nameSteffen Prohaska, Oct 14, 2007
  6. 5/6 add ref_cmp_full_short() comparing full ref name with a short nameSteffen Prohaska, Oct 14, 2007
  7. 6/6 push, send-pack: use same rules as git-rev-parse to resolve refspecsSteffen Prohaska, Oct 14, 2007
  8. 4/6 push, send-pack: support pushing HEAD to real ref nameSteffen Prohaska, Oct 14, 2007
  9. Johannes SchindelinOct 14, 2007
  10. Steffen ProhaskaOct 14, 2007
  11. 1/6 push, send-pack: fix test if remote branch exists for colon-less refspecSteffen Prohaska, Oct 14, 2007
  12. Steffen ProhaskaOct 14, 2007

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.