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

Re: [PATCH 3/4] refs.c: move ref parsing code out of resolve_ref()

From
Duy Nguyen <pclouds@gmail.com>
Date
Jul 26, 2014, 01:50 UTC
Message-ID
<CACsJy8DWEuiyyj0HhnGttnbyQ2+tTWDAW5H67uBXeV4ESM6seg@mail.gmail.com>
In-Reply-To
<CAL=YDWnWAoCrJn28vGKb=xrKKO=fCN=Uz+nM+eh+dYbHCFYpgQ@mail.gmail.com>
On Fri, Jul 25, 2014 at 11:12 PM, Ronnie Sahlberg <sahlberg@google.com> wrote:
Show 14 quoted lines
>> diff --git a/refs.c b/refs.c
>> index bec2bb1..2769f20 100644
>> --- a/refs.c
>> +++ b/refs.c
>> @@ -1533,6 +1533,105 @@ static int handle_missing_loose_ref(const char *refname,
>>         }
>>  }
>>
>> +int parse_ref(const char *path, struct strbuf *ref,
>> +             unsigned char *sha1, int *flag)
>
> Can you make this function static?
> It is not used by anything outside of this series and thus making it
> static avoids growing the public refs api.

It's to be used by builtin/checkout.c in nd/multiple-work-trees. I could mark it static now and unmark it later, but I'd need to add the static prototype back in refs.c because in the next patch resolve_gitlink_ref() uses this function and resolve_gitlink_ref() is before parse_ref().

-- 
Duy
Previous: Ronnie SahlbergNext: Nguyễn Thái Ngọc Duy
Message 10 of 11 in “Consolidate ref parsing code”
  1. 0/4 Consolidate ref parsing codeNguyễn Thái Ngọc Duy, Jul 25, 2014
  2. 1/4 strbuf.c: keep errno in strbuf_read_file()Nguyễn Thái Ngọc Duy, Jul 25, 2014
  3. Eric SunshineJul 25, 2014
  4. Michael HaggertySep 26, 2014
  5. 2/4 refs.c: refactor resolve_ref_unsafe() to use strbuf internallyNguyễn Thái Ngọc Duy, Jul 25, 2014
  6. Eric SunshineJul 25, 2014
  7. Junio C HamanoJul 30, 2014
  8. 3/4 refs.c: move ref parsing code out of resolve_ref()Nguyễn Thái Ngọc Duy, Jul 25, 2014
  9. Ronnie SahlbergJul 25, 2014
  10. Duy NguyenJul 26, 2014
  11. 4/4 refs.c: rewrite resolve_gitlink_ref() to use parse_ref()Nguyễn Thái Ngọc Duy, Jul 25, 2014

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.