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

[PATCH 0/4] Consolidate ref parsing code

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Jul 25, 2014, 10:43 UTC
Message-ID
<1406285039-22469-1-git-send-email-pclouds@gmail.com>
On Thu, Jul 24, 2014 at 4:16 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
>  - .... three places now knows what a
>    textual symref looks like (i.e. begins with "ref:", zero or more
>    whitespaces, the target ref and then zero or more trailing
>    whitespaces).  Perhaps we need to consolidate the code further,
>    so that this knowledge does not leak out of refs.c?

I started on top of nd/multiple-work-trees but it conflicts badly with rs/ref-transaction-0 because this is basically code move. So I think we should make it a separate topic instead, based on latest 'master'. Junio, you still hit conflicts when merging this with nd/multiple-work-trees, but that's simpler to resolve (git_snpath -> strbuf_git_path). I promise to replace the "ref:" code in checkout.c later when both topics graduate.

So.. first cut. The end result looks nice.
Nguyễn Thái Ngọc Duy (4):
  strbuf.c: keep errno in strbuf_read_file()
  refs.c: refactor resolve_ref_unsafe() to use strbuf internally
  refs.c: move ref parsing code out of resolve_ref()
  refs.c: rewrite resolve_gitlink_ref() to use parse_ref()
 cache.h  |  12 +++
 refs.c   | 332 ++++++++++++++++++++++++++++++++-------------------------------
 strbuf.c |   7 +-
 3 files changed, 188 insertions(+), 163 deletions(-)
-- 
1.9.1.346.ga2b5940
Next: Nguyễn Thái Ngọc Duy
Message 1 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.