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

Re: [PATCH] gitweb: Do not show 'patch' link in 'commit' view for merges

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 1, 2009, 09:18 UTC
Message-ID
<200910011118.02875.jnareb@gmail.com>
In-Reply-To
<20091001075540.GA13436@coredump.intra.peff.net>
Dnia czwartek 1. października 2009 09:55, Jeff King napisał:
Show 20 quoted lines
> On Thu, Oct 01, 2009 at 09:36:23AM +0200, Jakub Narebski wrote:
> 
> > From the point of view of code, 'patch' view is handled by git_patch()
> > subroutine, which in turn calls git_commitdiff(-format => 'patch', -single=> 1);
> > git_commitdiff checks if 'patch' view is enabled feature, and then 
> > composes and calls the following command (I have skipped --git-dir=...):
> > 
> >   git format-patch --encoding=utf8 --stdout -1 --root <commit-id>
> > 
> > And git-format-patch produces no output for merge commit.  Then 
> > git_commitdiff dumps output of git-format-patch
> 
> Ah, OK, I see the code path you are talking about now. My first thought
> was "shouldn't it be handling the merge case?" but that really doesn't
> make any sense. The "patch" view is just about something that can be
> given to "git am", and it doesn't understand merges anyway. And the
> "commitdiff" and "html" formats already handle it appropriately.
> 
> So I think your patch is the right thing to do. Thanks for the
> explanation.

I'll enhance commit message to talk about issues touched here (that 'patch' is for git-am and doesn't make sense for merges, regardless of possible bug in 'patch' view when used for merge commits), and check if this correction isn't needed also elsewhere.

I'll send v2 of this patch in a bit.
-- 
Jakub Narebski
Poland
Previous: Jeff KingNext: Jakub Narebski
Message 5 of 10 in “gitweb: Do not show 'patch' link in 'commit' view for merges”
  1. gitweb: Do not show 'patch' link in 'commit' view for mergesJakub Narebski, Sep 30, 2009
  2. Jeff KingOct 1, 2009
  3. Jakub NarebskiOct 1, 2009
  4. Jeff KingOct 1, 2009
  5. Jakub NarebskiOct 1, 2009
  6. gitweb: Do not show 'patch' link for merge commitsJakub Narebski, Oct 9, 2009
  7. Jakub NarebskiOct 9, 2009
  8. gitweb: Do not show 'patch' link for merge commitsJakub Narebski, Oct 9, 2009
  9. Jeff KingOct 9, 2009
  10. Junio C HamanoOct 10, 2009

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.