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

Re: [PATCH 1/3] Use startup_info->prefix rather than prefix.

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Mar 3, 2012, 09:50 UTC
Message-ID
<CACsJy8DtZLCLfeHNP_eq9kVZxjV3xh3gs6pgQCi=FDZ_Je7_Gw@mail.gmail.com>
In-Reply-To
<7v8vji87kg.fsf@alter.siamese.dyndns.org>
2012/3/3 Junio C Hamano <gitster@pobox.com>:
Show 21 quoted lines
> Jared Hance <jaredhance@gmail.com> writes:
>
>> In trace_repo_setup, prefix is passed in as startup_info->prefix. But, as
>> indicated but a FIXME comment, trace_repo_setup has access to
>> startup_info. The prefix parameter has therefor been eliminated.
>>
>> Signed-off-by: Jared Hance <jaredhance@gmail.com>
>> ---
>
> This comes from a9ca8a8 (builtins: print setup info if repo is found,
> 2010-11-26) and hasn't ever changed over time, even across f07d6a1 (setup:
> save prefix (original cwd relative to toplevel) in startup_info,
> 2010-12-01) that did add the necessary "prefix" field to the startup_info
> and was done reasonably close to the patch that wanted to have the field
> in the first place.
>
> The fix looks too easy to be correct X-<; in other words, I find it hard
> to believe that such a triviality was left without a good reason, but I do
> not think of any.
>
> Well, but perhaps something too good to be true is indeed true sometimes.

This patch makes this function only usable when startup_info pointer is initialized. As "git" binary is the only caller, the change is ok. If non-builtin commands want to use this function, they need to initialize startup_info first.

-- 
Duy
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 18 in “Fix some documented fixmes”
  1. 0/3 Fix some documented fixmesJared Hance, Mar 3, 2012
  2. 1/3 Use startup_info->prefix rather than prefix.Jared Hance, Mar 3, 2012
  3. Junio C HamanoMar 3, 2012
  4. Nguyen Thai Ngoc DuyMar 3, 2012
  5. Junio C HamanoMar 3, 2012
  6. Jared HanceMar 3, 2012
  7. 2/3 Fix memory leak in apply_patch in apply.c.Jared Hance, Mar 3, 2012
  8. Junio C HamanoMar 3, 2012
  9. 3/3 Add threaded versions of functions in symlinks.c.Jared Hance, Mar 3, 2012
  10. Junio C HamanoMar 3, 2012
  11. 0/3 Fix a few documents fixmesJared Hance, Mar 3, 2012
  12. 1/3 Use startup_info->prefix rather than prefix.Jared Hance, Mar 3, 2012
  13. Jeff EplerMar 3, 2012
  14. 2/3 Fix memory leak in apply_patch in apply.c.Jared Hance, Mar 3, 2012
  15. Jared HanceMar 3, 2012
  16. Junio C HamanoMar 3, 2012
  17. 3/3 Add threaded versions of functions in symlinks.c.Jared Hance, Mar 3, 2012
  18. Thomas RastMar 5, 2012

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.