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

Re: [PATCH 1/3] name-hash: refactor polymorphic index_name_exists()

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 13, 2013, 22:16 UTC
Message-ID
<xmqqfvt8iczh.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAPig+cS4x1h3v2=0T95+g2_08_7qZj7fUsSiLgDtFyRSbFE0bA@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 5 quoted lines
> Given the above. How should I proceed? Do you still feel that it is
> advisable to keep an index_name_exists() around for compatibility
> reasons in case any new callers are introduced? Regardless of that
> answer, do you want index_name_exists() renamed to
> index_file_exists()?

Renaming *_name_exists() to *_file_exists() without keeping a compatibility one will force new topics to be rebased on this series. Alternatively we could merge them to 'pu' (and later 'next' and 'master') with evil merges to adjust the change in the semantics of the called function. That increases the risk of accidental breakages, I think.

It is safer to keep index_name_exists() around with the older semantics, if we can, and rename your "file only" one to a different name. That way, even if a new topic still uses index_name_exists() expecting the traditional behaviour, it will not break immediately and we do not need to risk evil merges making mistakes.

Later, we can "git grep _name_exists" to spot them and convert such old-style calls to either "directory only" or "file only" variants after this series and these follow-on topics hit 'master' (and we do not know at this point in what order that happens).

Hmm?
Previous: Eric SunshineNext: Eric Sunshine
Message 8 of 9 in “stop storing trailing slash in dir-hash”
  1. 0/3 stop storing trailing slash in dir-hashEric Sunshine, Sep 13, 2013
  2. 1/3 name-hash: refactor polymorphic index_name_exists()Eric Sunshine, Sep 13, 2013
  3. Junio C HamanoSep 13, 2013
  4. Eric SunshineSep 13, 2013
  5. 2/3 name-hash: stop storing trailing '/' on paths in index_state.dir_hashEric Sunshine, Sep 13, 2013
  6. 3/3 dir: revert work-around for retired dangerous behaviorEric Sunshine, Sep 13, 2013
  7. Eric SunshineSep 13, 2013
  8. Junio C HamanoSep 13, 2013
  9. Eric SunshineSep 13, 2013

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.