From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH/RFC 1/x] gitweb: Use git-diff-tree patch output for commitdiff
Date: Thu, 24 Aug 2006 13:10:13 +0200 [thread overview]
Message-ID: <eck1em$p8b$1@sea.gmane.org> (raw)
In-Reply-To: 7v3bbmhoa2.fsf@assigned-by-dhcp.cox.net
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>> Converting "blobdiff" and "blobdiff_plain" format would be much easier
>> if git-diff-tree and friends had -L <label>/--label=<label> option,
>> like GNU diff has.
>
> I am not sure how that would be useful, given that you would
> disect the header line-by-line to colorize anyway.
gitweb could output patch directly (slurp-print) in blobdiff_plain,
if there were -L <label>/--label=<label> option to git-diff. As it is now
git_blobdiff_plain (or git_blobdiff('plain')) would have to process diff
header, replacing hashes by file names.
Anyway to get full information you need commits to diff, not only blobs to
diff, otherwise the mode change information is lost, I think. And then we
would be able to reus git_patchset_body for git_blobdiff...
>> Current patch preserves much of current output; the question is if for
>> example generate if 'plain' format should generate patch which could
>> be appplied by ordinary patch which do not understand git diff
>> extensions (including renaming and copying), as it is done in current
>> version, and if 'html' version should detect renames and copying.
>
> I would say html is definitely for human consumption; does
> anybody cut&paste html patch and expect to apply that? Plain
> format I am easy but probably enabling rename is fine. You can
> edit the header or tell patch to apply to which file anyway, and
> I think the value of being able to view the real changes outweigh
> that inconvenience.
Or I we can add another format/option, 'broken' to git_commitdiff
and friends.
>> * "commitdiff" now products patches with renaming and copying
>> detection (git-diff-tree is invoked with -M and -C options).
>
> You do not have to give -M and -C; a single -C is enough.
> I wonder if -B is also useful as a default (i.e. -B -C).
So -C implies -M?
> For a merge, I often would want to see --cc just like gitk does,
> but it is probably just me.
Planned. The problem is that raw format for --cc differs, and parser
has to be improved (and similarity is lost)
> I do not know we would want to slurp the entier diff in an
> array before processing. Is this easy to streamify by passing
> an pipe fd to the formatting sub?
That was one question I meant to ask: slurp entire diff (process
then output rule) or streamify (streamify larger output for faster
result)? Will do (quite easy).
>> Empty patches (mode changes and pure renames and copying)
>> are not written currently.
>
> That's quite bad.
This can be easily changed. Question: what format? Current "gitweb diff
header" (<filetype>:<sha1 link> -> <filetype>:<sha1 link>) has no place for
that. Can be easily changed.
Another question: do output difftree in commitdiff, like in commit view?
Do write out extended header, perhaps except index line (repeats information
in "gitweb diff header")?
>> * "commitdiff_plain" now only generates X-Git-Tag: line only if there
>> is tag pointing to the current commit.
>
> Hmph...
>
>> ...; besides we are
>> interested rather in tags _preceding_ the commit, and _heads_
>> following the commit.
>
> Interesting observation. When somebody says "feature X was
> introduced in such and such commit", people would want to know (1) the
> point release they are using has the feature -- which means you
> would want to know the earliest tag that comes after the commit,
> or (2) if the branch they are working on already has that
> feature -- which again means if the head follows the commit. So
> I am not sure when preceding tag is interesting...
Qgit and gitk both show "Follows:" listing followed = preceding tag(s).
This answers question if given commit has given feature.
I have planned separating generation of first/all preceding/following
tags/heads (from git_get_references) into subroutines anyway.
I will add 'X-Git-Tag-After:' then.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
next prev parent reply other threads:[~2006-08-24 11:11 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 [this message]
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
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='eck1em$p8b$1@sea.gmane.org' \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
/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).