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

Re: Multiple user questions

From
Jakub Narebski <jnareb@gmail.com>
Date
May 24, 2008, 12:33 UTC
Message-ID
<200805241433.42954.jnareb@gmail.com>
In-Reply-To
<200805241113.57848.devurandom@gmx.net>
Dnia sobota 24. maja 2008 11:13, Dennis Schridde napisał:
> Thanks for your answers!
You are welcome.
 
Show 11 quoted lines
> Am Samstag, 24. Mai 2008 03:30:43 schrieb Jakub Narebski:
>> Dennis Schridde <devurandom@gmx.net> writes:
>>> 2) Can I make format-patch include the full commit message, date, author,
>>> stats in the patches? (To mimic what git-show would show me.)
>>> Will this be sent via send-email, too?
>>
>> Errr... git-format-patch output _does_ include full commit message,
>> author, author date and diffstat.
>>
> For me only the first line of the commit message is printed in the subject, 
> all other lines are missing.

What version of git do you use? If I remember correctly this area was worked on some time ago, so git-format-patch takes now whole first paragraph as a subject of email, folding it using appropriate RFC style.

Note though that git-am migh convert this first paragraph to single line, losing formatting in the progress. I think there is some option to preserve formatting.

> If I want a message to appear in the body at all, I need a special way to 
> format my commit messages: 1 line summary, 1 empty line, description.
> Only the description is then shown in the email.
> This seems inconvenient, especially for smaller changes.

What do you think this commit message convention git uses is from? It stems from exchanging patches by email, where you had to put short, single line description in the email subject, and describe change in more detail in message (email) body. If you don't follow this commit message convention many git tools (tig, gitk, git-shortlog, etc.) will not work as expected.

> Further, attachments do not at all contain any information like that.
> See the attached example.

Errr... I just tried "git format-patch --attach"[1] and it creates by default multi-part attachement, first part is commit message, second is patch itself. The commit message contains diffstat.

This is if I remember correctly quite new thing, so it might need some polishing.

[1] I use git version 1.5.5
Show 7 quoted lines
>>> 4) Can I make format-patch output one deletion and one insertion for a
>>> complete rewrite of a function, instead of multiple deletes/inserts?
>>
>> Try git-format-patch with -B option, or -B<num>.
>>
> I tried that already.  Whether I specified -B or not, it always gave
> the exact same output (says diff).

Ah, I'm sorry. The -B is to recognize total rewrite, i.e. such a change that is best represent as delete old contents and create new one.

If I remember correctly there was some work lately, I think by Linus, to join together neighbour chunks to make diff more readable. But I think there were no configurable parameters... I also don't remember if it hit released version...

> The <num> parameter to -B is not mentioned or explained in the manpages.

It is explained in diffcore, which in future version of git would be in manpage, and not only as HTML / text documentation.

-- 
Jakub Narebski
Poland
Previous: Dennis SchriddeNext: Dennis Schridde
Message 5 of 7 in “Multiple user questions”
  1. Dennis SchriddeMay 23, 2008
  2. Dennis SchriddeMay 23, 2008
  3. Jakub NarebskiMay 24, 2008
  4. Dennis SchriddeMay 24, 2008
  5. Jakub NarebskiMay 24, 2008
  6. Dennis SchriddeMay 25, 2008
  7. Jakub NarebskiMay 27, 2008

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.