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

[PATCH 0/2] resurrect format-patch's patch id checking

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 25, 2006, 01:50 UTC
Message-ID
<Pine.LNX.4.63.0606250349280.29667@wbgn013.biozentrum.uni-wuerzburg.de>
With these patches, you can say
	git format-patch --ignore-if-in-upstream upstream
to get a series of only the patches which are in HEAD, but not upstream.

The first patch adds diff_flush_patch_id() to calculate the patch id, after a diff queue was set up. (Earlier, I sent out a version which also adds a command line option to the diff family, but I'll postpone that until Timo's patches went in).

The second patch adds the actual patch id checking. There are two tricky things involved:

	- I add a pseudo-object for each patch of the upstream, which has
	  the patch id as sha1. This is no real object, but since we rely
	  on the hashes being unique for all practical purposes, and since
	  it has parsed == 0, it should be no problem.
	- To add the patch ids of the upstream, the revision walker must
	  be called twice.
	  So, if format-patch was called with a range "a..b" (a single
	  revision "a" is handled as "a..HEAD" by format-patch), a revision
	  walker is set up for "b..a", and the patch ids are calculated and
	  stored. This is done by toggling the UNINTERESTING bits of both
	  pending objects.
	  After that, the flags of all objects are reset to 0, so that the
	  revisions can be walked again. The flags of the two pending objects
	  are then reset to their original state.
Note that "--numbered" still works.
WARNING: since it is quite late in this part of the world, _and_ I am known
to produce not-always-optimal patches which could eat your children, please
give this a good beating.

Ciao, Dscho

Next: Johannes Schindelin
Message 1 of 20 in “resurrect format-patch's patch id checking”
  1. 0/2 resurrect format-patch's patch id checkingJohannes Schindelin, Jun 25, 2006
  2. 3/2 format-patch: use clear_commit_marks() instead of some adhoceryJohannes Schindelin, Jun 26, 2006
  3. Junio C HamanoJun 26, 2006
  4. Johannes SchindelinJun 26, 2006
  5. Martin LanghoffJun 26, 2006
  6. Johannes SchindelinJun 26, 2006
  7. Martin LanghoffJun 26, 2006
  8. Johannes SchindelinJun 26, 2006
  9. Junio C HamanoJun 26, 2006
  10. format-patch: support really old non-range syntax, with a warningJohannes Schindelin, Jun 26, 2006
  11. Martin Langhoff (CatalystIT)Jun 26, 2006
  12. Johannes SchindelinJun 26, 2006
  13. Johannes SchindelinJun 27, 2006
  14. Martin LanghoffJun 27, 2006
  15. Johannes SchindelinJun 27, 2006
  16. Martin LanghoffJun 27, 2006
  17. Johannes SchindelinJun 27, 2006
  18. Junio C HamanoJun 26, 2006
  19. Johannes SchindelinJun 26, 2006
  20. format-patch: use clear_commit_marks() instead of some adhoceryJohannes Schindelin, Jun 27, 2006

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.