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

Re: [PATCH 19/19] gitweb: Remove creating directory for temporary files

From
Junio C Hamano <junkio@cox.net>
Date
Aug 27, 2006, 02:51 UTC
Message-ID
<7v3bbizya1.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<ecqaa3$j0u$1@sea.gmane.org>
Jakub Narebski <jnareb@gmail.com> writes:
Show 10 quoted lines
> Junio C Hamano wrote:
>
>> Jakub Narebski <jnareb@gmail.com> writes:
>> 
>>  * 13/19 gitweb: Add invisible hyperlink to from-file/to-file diff header
>> 
>>    You seem to have forgotten esc_html() on the patch-line
>>    before sending it to the browser.  Careful.
>
> Cannot esc_html() line with HTML code, namely the hyperlink.

OK, I did not notice the lines are already HTMLified with links at that point.

Show 8 quoted lines
>>  * 14/19 gitweb: Always display link to blobdiff_plain in git_blobdiff
>> 
>>    Need justification why this change is needed (or why previous
>>    logic to avoid showing it in certain cases is wrong).
>
> Why we didn't display it before? I though it was a bug (oversimplification
> in case we don't have $hash_base or it is not a commit). If we can display
> "blob" view, we can display "blob_plain" view...

I take it that you mean that it avoids the case without $hash_base even though it can do all the necessary computation without it. If so please say that in the commit log message.

Show 5 quoted lines
>>    You seem to spell out '-M', '-C' everywhere.  I suspect
>>    fixing them all to just '-C' (or perhaps '-B', '-C') would be
>>    tedious but probably is a good idea.
>
> Does '-C' imply '-M'?

They are, in this order "-M" < "-C" < "--find-copies-harder -C", strict superset/subset of each other.

Having said that, I think just -M (or perhaps -B -M) might be a better default (or "only choice" if the UI does not give a choice), for a few reasons:

 * -C tends to be far more expensive than -M.  The cost of -M is
    proportional to (number of removed files) * (number of new
    files).  The cost of -C is proportional to (number of
    changed files + number of removed files) * (number of new
    files).  For -C with --find-copies-harder, the cost is still
    more expensive: (number of files in the original tree) *
    (number of new files).
 * -C does not detect all copies.  It considers only the
    pre-image of files changed in the same commit as candidates
    of copy source.  To make it consider _any_ file that was in
    the original tree, you would need to give --find-copies-harder
    as well.  In a way, -C is a cheaper (but still more
    expensive) compromise, middle ground between -M and -C
    --find-copies-harder.
Show 11 quoted lines
>>  * 17/19 gitweb: git_blobdiff_plain is git_blobdiff('plain')
>> 
>>    Needs justification why commitdiff and blobdiff plain needs
>>    to behave differently.
>
> First, if we have blobdiff generated with renames/copying detection (and
> "commit" view uses it, and provides link to blobdiffs using it), there not
> always is single diff (blobdiff) without renames/copying detection. So to
> have blobdiff and blobdiff_plain equivalent, and blobdiff_plain without
> renames detection, then blobdiff_plain view would have sometimes _two_
> patches.

Sorry, does not parse, but two paragraphs below I think you made it clear why.

Show 11 quoted lines
> The idea behind changing comittdiff (HTML version) to including rename
> detection was that it gives shorter and better to understand patches. The
> idea (perhaps wrong) behind leaving comitdiff_plain output without renames
> detection was that this output can be applied directly by non-git-aware
> tools. It can be easily changed to include renames/copying detection (put
> '-C' in one place).
>
> The idea behind having both blobdiff and blobdiff_plain have renames
> detection was that commit view used rename detection, the two views should
> be equivalent and one exist always for the other, and that it was easier on
> implementation ;-)

I am not sure about this. People, especially the ones who do _not_ use git and are interested in one single fix, are the ones you are trying to help, because they can just be told about the change (e.g. "'Fix bar blah' patch in Linus tree last week might fix your problems"), go to gitweb and use it. But:

 (0) If rename/copy is not involved there is no difference so I
     will not discuss that case further;
 (1) If rename/copy is involved, as you say, the patch is far
     easier to understand in git form; the person who downloaded
     the patch would have a hard time understanding it before
     applying the patch if you do not do -M/-C.
 (2) The post-image file would not exist in the tree the person
     who downloaded the patch has for renamed/copied paths, so
     failure from "patch -p1" is immediately noticeable.  The
     metainformation says what was renamed/copied where, and I
     do not think it is too much to expect for them to first
     rename/copy by hand then re-run "patch -p1".
 (3) If we do not do -M, in situations where the patch has fuzz
     or conflict when applied to the tree the person who
     downloaded has, the post-image patch will be applied
     cleanly and the removal patch will have conflict or fuzz.
     The local change can easily be lost that way.
> P.S. I have most problems with having legacy blobdiff URL (without 'hpb' 
> i.e. hash_parent_base parameter) working correctly without making use of
> external diff.

Are people bookmarking such URLs? How important is the legacy compatibility?

Previous: Jakub NarebskiNext: Junio C Hamano
Message 46 of 53 in “gitweb: Use git-diff-tree patch output for commitdiff”
  1. gitweb: Use git-diff-tree patch output for commitdiffJakub Narebski, Aug 23, 2006
  2. gitweb: Replace git_commitdiff_plain by anonymous subroutineJakub Narebski, Aug 23, 2006
  3. gitweb: Show information about incomplete lines in commitdiffJakub Narebski, Aug 23, 2006
  4. Junio C HamanoAug 24, 2006
  5. Jakub NarebskiAug 24, 2006
  6. Junio C HamanoAug 24, 2006
  7. Jakub NarebskiAug 24, 2006
  8. Junio C HamanoAug 24, 2006
  9. Jakub NarebskiAug 24, 2006
  10. Marco CostalbaAug 25, 2006
  11. Jakub NarebskiAug 25, 2006
  12. gitweb: Remove invalid comment in format_diff_lineJakub Narebski, Aug 24, 2006
  13. gitweb: Streamify patch output in git_commitdiffJakub Narebski, Aug 24, 2006
  14. gitweb: Add git_get_{following,preceding}_references functionsJakub Narebski, Aug 24, 2006
  15. gitweb: Faster return from git_get_preceding_references if possibleJakub Narebski, Aug 24, 2006
  16. gitweb: Add git_get_rev_name_tags functionJakub Narebski, Aug 24, 2006
  17. gitweb: Use git_get_name_rev_tags for commitdiff_plain X-Git-Tag: headerJakub Narebski, Aug 24, 2006
  18. gitweb: Add support for hash_parent_base parameter for blobdiffsJakub Narebski, Aug 24, 2006
  19. gitweb: Add support for hash_parent_base parameter for blobdiffsJakub Narebski, Aug 24, 2006
  20. 11/19 gitweb: Allow for pre-parsed difftree info in git_patchset_bodyJakub Narebski, Aug 25, 2006
  21. 12/19 gitweb: Parse two-line from-file/to-file diff header in git_patchset_bodyJakub Narebski, Aug 25, 2006
  22. 13/19 gitweb: Add invisible hyperlink to from-file/to-file diff headerJakub Narebski, Aug 25, 2006
  23. Linus TorvaldsAug 27, 2006
  24. 14/19 gitweb: Always display link to blobdiff_plain in git_blobdiffJakub Narebski, Aug 25, 2006
  25. 15/19 gitweb: Change here-doc back for style consistency in git_blobdiffJakub Narebski, Aug 25, 2006
  26. 16/19 gitweb: Use git-diff-tree or git-diff patch output for blobdiffJakub Narebski, Aug 25, 2006
  27. Jakub NarebskiAug 26, 2006
  28. Junio C HamanoAug 26, 2006
  29. Jakub NarebskiAug 26, 2006
  30. gitweb: Remove workaround for git-diff bug fixed in f82cd3cJakub Narebski, Aug 26, 2006
  31. 17/19 gitweb: git_blobdiff_plain is git_blobdiff('plain')Jakub Narebski, Aug 25, 2006
  32. 18/19 gitweb: Remove git_diff_print subroutineJakub Narebski, Aug 25, 2006
  33. 19/19 gitweb: Remove creating directory for temporary filesJakub Narebski, Aug 25, 2006
  34. Marco CostalbaAug 25, 2006
  35. Jakub NarebskiAug 25, 2006
  36. Junio C HamanoAug 26, 2006
  37. Marco CostalbaAug 26, 2006
  38. Junio C HamanoAug 26, 2006
  39. Marco CostalbaAug 26, 2006
  40. Marco CostalbaAug 26, 2006
  41. Shawn PearceAug 26, 2006
  42. Josef WeidendorferAug 26, 2006
  43. Jakub NarebskiAug 26, 2006
  44. Junio C HamanoAug 26, 2006
  45. Jakub NarebskiAug 26, 2006
  46. Junio C HamanoAug 27, 2006
  47. Junio C HamanoAug 27, 2006
  48. Jakub NarebskiAug 27, 2006
  49. 00/19 gitweb: Remove dependency on external diff and need for temporary filesJakub Narebski, Aug 25, 2006
  50. Linus TorvaldsAug 27, 2006
  51. David MillerAug 27, 2006
  52. Linus TorvaldsAug 27, 2006
  53. Jakub NarebskiAug 27, 2006

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.