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

Re: [PATCH] Name make_*_path functions more accurately

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Mar 18, 2011, 08:06 UTC
Message-ID
<4D83128D.6020206@drmicha.warpmail.net>
In-Reply-To
<7vipvgyjnl.fsf@alter.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 18.03.2011 08:25:
Show 24 quoted lines
> Carlos Martín Nieto <cmn@elego.de> writes:
> 
>> Rename the make_*_path functions so it's clearer what they do, in
>> particlar make clear what the differnce between make_absolute_path and
>> make_nonrelative_path is by renaming them real_path and absolute_path
>> respectively. make_relative_path has an understandable name and is
>> renamed to relative_path to maintain the name convention.
> 
> The approach taken by this patch is a sound one, and I like it.  The
> change does not reuse any existing name for different purpose, which means
> there is little chance of this change interacting other topics that may be
> in flight that introduce new call sites to these renamed functions in a
> funny way.  A (semantic) mismerge or misapplication of the patch will be
> found by the compiler.
> 
> For example, the version of setup.c this patch is based on the version
> before 05f08e4 (Merge branch 'cb/setup', 2011-02-09) was merged, and the
> merge introduced a new call site to make_absolute_path().  A few callsites
> to make_nonrelative_path() in wrapper.c were introduced at 70ec868 (Merge
> branch 'ae/better-template-failure-report', 2011-02-09), and this patch
> does not touch them.
> 
> As the result, the patch cleanly applies textually, but the resulting code
> does not compile, and it is a good thing ;-).

...because the "diff --color-words" for this version of the patch makes it clear you only have to rerun

sed -e 's/make_absolute_path/real_path/g'
etc. on the affected files to resolve this "merge-compile conflict".

Just pointing it out for those who wonder why I pestered Carlos to bring the patch into this form, and why Junio started to like failed builds. Also, I need to make-up for making Junio explain my recent RFD :)

Cheers, Michael

Previous: Junio C Hamano
Message 3 of 3 in “Name make_*_path functions more accurately”
  1. Name make_*_path functions more accuratelyCarlos Martín Nieto, Mar 17, 2011
  2. Junio C HamanoMar 18, 2011
  3. Michael J GruberMar 18, 2011

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.