git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 19/19] gitweb: Remove creating directory for temporary files
Date: Sat, 26 Aug 2006 12:25:40 -0700	[thread overview]
Message-ID: <7vpsen1eq3.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 200608252135.27894.jnareb@gmail.com

Jakub Narebski <jnareb@gmail.com> writes:

> Remove $git_temp variable which held location for temporary files
> needed by git_diff_print, and removed creating $git_temp directory.

Very good.  Not writing into the filesystem even in the
temporary location is a very good thing.

Other things I noticed in this 19 series (note that I've applied
them more or less intact already, expecting that any issues will
be fixed in-tree):

 * Overall

   Your MUA configuration seems to have improved and stabilized
   quite a bit.  I did not see any corruption this time around.

 * 01/19 gitweb: Use git-diff-tree patch output for commitdiff

   This was a bit large for me to review during work-day, and
   seemed a bit scary.  It initially did not give me a good
   feeling to see that a large series that followed depended on
   something that was marked RFC, but it turned out mostly Ok.

 * 02/19 gitweb: Replace git_commitdiff_plain by anonymous subroutine
   03/19 gitweb: Show information about incomplete lines in commitdiff
         Revert "gitweb: Replace git_commitdiff_plain by anonymous
                 subroutine"

   I've commented on these.

 * 06/19 gitweb: Add git_get_{following,preceding}_references functions
   07/19 gitweb: Return on first ref found when
         git_get_preceding_references is called in scalar context

   This looks *VERY* expensive.  Does git_get_references()
   cache and reuse its result?  How many times during a single
   invocation are these subs called?

   Also I am not sure about the correctness of "get-following".

            B------D------F
           /              base
	--A------C------E
                        hash

   You read from "rev-list $base", stop when you see $hash, and
   grab all the refs that point at the rev you have seen before
   stopping as "following".  But in the above picture, you will
   follow from F down to the very initial commit without
   stopping and there actually is _no_ rev that follows E so
   your result would contain B D A (if they are tagged) but none
   of them follows E.  There is something wrong here.

   At least you should read from "rev-list $hash..$base"; then
   traversal would go F D B and stop at A; you probably would
   want --boundary to force showing of A as well, but even then
   I am not sure how well the result would work.

   "get-preceding" also wants to go down to the initial commit.

   "get-following" is inherently a very expensive operation, so
   I would suggest not doing this.  It seems that nobody uses
   these two subs yet, so probably it is better to yank them
   before they cause damages.

 * 08/19 gitweb: Add git_get_rev_name_tags function
   09/19 gitweb: Use git_get_name_rev_tags for commitdiff_plain 
         X-Git-Tag: header

   I suspect these make the generation of the header extremely
   expensive.  I'd suggest reverting them to the original.

 * 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.

 * 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).

 * 16/19 gitweb: Use git-diff-tree or git-diff patch output for blobdiff

   Is git_to_hash sub always called with object names and
   nothing else?  "git rev-parse no-such" would die with an
   error message, and "git rev-parse Makefile" in populated
   working tree would say "Makefile" without complaints.
   Perhaps you want --revs-only --no-flags here.

   I think it is a bad style to return [] or $ in scalar context
   depending on the number of results.  It forces the caller to
   do a conditional depending on the type of the stuff returned.

   I would suggest just removing if (wantarray) and always
   return @hashes.  A caller who is interested in a single
   element can say "($it) = your_sub(...)", a caller who wants
   the number of elements can say "$cnt = your_sub(...)", and a
   caller who wants to know all can say "(@them) = your_sub(...)".

   I think that is the usual thing to do in Perl.  Unless there
   is a compelling reason that is so important that it is worth
   to deviate from that norm and confusing the programmer, that
   is.

   I think "# try to find filename from $hash" part would
   misbehave if $hash returned by git_to_hash($hash) becomes
   undef.

   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.

 * 17/19 gitweb: git_blobdiff_plain is git_blobdiff('plain')

   Needs justification why commitdiff and blobdiff plain needs
   to behave differently.

  parent reply	other threads:[~2006-08-26 19:25 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-23 22:15 [PATCH/RFC 1/x] gitweb: Use git-diff-tree patch output for commitdiff Jakub Narebski
2006-08-23 23:58 ` [PATCH 2] gitweb: Replace git_commitdiff_plain by anonymous subroutine Jakub Narebski
2006-08-23 23:58 ` [PATCH 3] gitweb: Show information about incomplete lines in commitdiff Jakub Narebski
2006-08-24  2:21   ` Junio C Hamano
2006-08-24 11:12     ` Jakub Narebski
2006-08-24  2:15 ` [PATCH/RFC 1/x] gitweb: Use git-diff-tree patch output for commitdiff Junio C Hamano
2006-08-24 11:10   ` Jakub Narebski
2006-08-24 18:45     ` Junio C Hamano
2006-08-24 18:56       ` Jakub Narebski
2006-08-25 17:32     ` Marco Costalba
2006-08-25 18:18       ` Jakub Narebski
2006-08-24 17:32 ` [PATCH 4] gitweb: Remove invalid comment in format_diff_line Jakub Narebski
2006-08-24 17:34 ` [PATCH 5] gitweb: Streamify patch output in git_commitdiff Jakub Narebski
2006-08-24 17:37 ` [PATCH 6] gitweb: Add git_get_{following,preceding}_references functions Jakub Narebski
2006-08-24 17:39 ` [PATCH 7] gitweb: Faster return from git_get_preceding_references if possible Jakub Narebski
2006-08-24 17:41 ` [PATCH 8] gitweb: Add git_get_rev_name_tags function Jakub Narebski
2006-08-24 17:45 ` [PATCH 9] gitweb: Use git_get_name_rev_tags for commitdiff_plain X-Git-Tag: header Jakub Narebski
2006-08-24 18:50 ` [PATCH 10] gitweb: Add support for hash_parent_base parameter for blobdiffs Jakub Narebski
2006-08-24 21:53 ` [PATCH 10 (amended)] " Jakub Narebski
2006-08-25 18:59 ` [PATCH 11/19] gitweb: Allow for pre-parsed difftree info in git_patchset_body Jakub Narebski
2006-08-25 19:04 ` [PATCH 12/19] gitweb: Parse two-line from-file/to-file diff header " Jakub Narebski
2006-08-25 19:05 ` [PATCH 13/19] gitweb: Add invisible hyperlink to from-file/to-file diff header Jakub Narebski
2006-08-27  3:38   ` Linus Torvalds
2006-08-25 19:05 ` [PATCH 14/19] gitweb: Always display link to blobdiff_plain in git_blobdiff Jakub Narebski
2006-08-25 19:06 ` [PATCH 15/19] gitweb: Change here-doc back for style consistency " Jakub Narebski
2006-08-25 19:13 ` [PATCH 16/19] gitweb: Use git-diff-tree or git-diff patch output for blobdiff Jakub Narebski
2006-08-26  9:23   ` Jakub Narebski
2006-08-26 10:14     ` Junio C Hamano
2006-08-26 10:17       ` Jakub Narebski
2006-08-26 10:33   ` [PATCH 16a/19] gitweb: Remove workaround for git-diff bug fixed in f82cd3c Jakub Narebski
2006-08-25 19:14 ` [PATCH 17/19] gitweb: git_blobdiff_plain is git_blobdiff('plain') Jakub Narebski
2006-08-25 19:15 ` [PATCH 18/19] gitweb: Remove git_diff_print subroutine Jakub Narebski
2006-08-25 19:35 ` [PATCH 19/19] gitweb: Remove creating directory for temporary files Jakub Narebski
2006-08-25 21:33   ` Marco Costalba
2006-08-25 21:48     ` Jakub Narebski
2006-08-26  2:05     ` Junio C Hamano
2006-08-26  4:44       ` Marco Costalba
2006-08-26  5:13         ` Junio C Hamano
2006-08-26  5:34           ` Marco Costalba
2006-08-26  5:43             ` Marco Costalba
2006-08-26  5:40           ` Mozilla import and large history Shawn Pearce
2006-08-26  0:26   ` [PATCH 19/19] gitweb: Remove creating directory for temporary files Josef Weidendorfer
2006-08-26  0:46     ` Jakub Narebski
2006-08-26 19:25   ` Junio C Hamano [this message]
2006-08-26 20:18     ` Jakub Narebski
2006-08-27  2:51       ` Junio C Hamano
2006-08-27  0:24     ` Junio C Hamano
2006-08-27  0:38       ` Jakub Narebski
2006-08-25 21:15 ` [PATCH 00/19] gitweb: Remove dependency on external diff and need " Jakub Narebski
2006-08-27  3:30   ` Linus Torvalds
2006-08-27  3:42     ` David Miller
2006-08-27  3:54       ` Linus Torvalds
2006-08-27 15:37     ` Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vpsen1eq3.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).