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

Re: patches between commits

From
Junio C Hamano <junkio@cox.net>
Date
Dec 12, 2005, 17:54 UTC
Message-ID
<7vu0dei4ka.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20051212173352.GA3007@steel.home>
Alex Riesen <raa.lkml@gmail.com> writes:
Show 7 quoted lines
> Bahadir Balban, Mon, Dec 12, 2005 16:31:12 +0100:
>> Suppose I have a HEAD branch, which is the latest. And I want to
>> generate `individual' patches for each commit I did since the
>> beginning of development for this branch.
>
> That is what I think "git format-patch <commit>" is for. It will
> generate patches to bring "<commit>" to HEAD.

Yes, but I think the real question Bahadir wants to know is what the <commit> parameter should be, if you want to export the whole history (I do not think there is any suitable argument to "format-patch" that does this).

>> Secondly, is the sha1 of a tree what appears next to each commit when
>> I type git-log? Is this the only command that lets us know the sha1's
>> of commits?

Depends on what you have, to ask the question "what are their object names?".

 - I have this commit, how do I find out its object name?
   E.g. I want to know the HEAD commit's object name, second to
   the last commit on "test" branch.
   $ git rev-parse --verify HEAD
   $ git rev-parse --verify test^
 - I have bunch of commits leading to the head of my "test"
   branch.  What are they?
   $ git rev-list test ;# unadorned list of object names and nothing else
   $ git rev-list --pretty test ;# this is git-log
   $ git whatchanged -m -M -p test ;# with patch in full glory
Previous: Alex Riesen
Message 3 of 3 in “patches between commits”
  1. Bahadir BalbanDec 12, 2005
  2. Alex RiesenDec 12, 2005
  3. Junio C HamanoDec 12, 2005

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.