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

Re: [PATCH 1/2] gitweb: Always set 'from_file' and 'to_file' in parse_difftree_raw_line

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 1, 2007, 23:46 UTC
Message-ID
<200711020046.26083.jnareb@gmail.com>
In-Reply-To
<7v7il18twn.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 13 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
> 
>> Always set 'from_file' and 'to_file' keys when parsing raw diff output
>> format line, even if filename didn't change (file was not renamed).
>> This allows for simpler code (and no problems with file named '0').
>>
>> Use
>>   $diffinfo->{'from_file'}
>> instead of
>>   $diffinfo->{'from_file'} || $diffinfo->{'file'}
>> from now on.
> 
> Isn't this description the other way around?

Description is in good direction, although I agree that it is a bit awkward. Perhaps it should read:

Instead of
  $diffinfo->{'from_file'} || $diffinfo->{'file'}
it is now enough to use
  $diffinfo->{'from_file'}

(because $diffinfo->{'from_file'} is now _always_ set, not only for renames and copies, when from_name and to_name differ).

-- 
Jakub Narebski
Poland
Previous: Junio C HamanoNext: Jakub Narebski
Message 4 of 5 in “gitweb: Simplify dealing with raw diff output”
  1. 0/2 gitweb: Simplify dealing with raw diff outputJakub Narebski, Nov 1, 2007
  2. 1/2 gitweb: Always set 'from_file' and 'to_file' in parse_difftree_raw_lineJakub Narebski, Nov 1, 2007
  3. Junio C HamanoNov 1, 2007
  4. Jakub NarebskiNov 1, 2007
  5. 2/2 gitweb: Add 'status_str' to parse_difftree_raw_line outputJakub Narebski, Nov 1, 2007

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.