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

Re: [PATCH] patch-ids.c: cache patch IDs in a notes tree

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 11, 2013, 23:57 UTC
Message-ID
<alpine.DEB.1.00.1305111846160.8213@s15462909.onlinehome-server.info>
In-Reply-To
<CA+55aFzinmXA2HtA3hmN1VVOcLPWedfqJRws0RJMEc1By1VLLg@mail.gmail.com>
Hi John & Linus,
On Sat, 11 May 2013, Linus Torvalds wrote:
> [...] I really think caching patch ID's should be something people
> should be aware of is fundamentally wrong, even if it might work.

Given the incredible performance win, I would say it is still worth looking into.

If you store also a hash of Git version and diff options (may even be the hash of the raw bytes of the diff options if you do not plan to share the ref between machines) with the patch ID, you can make it safe.

That hash would be generated at patch_id init time and load_cached_patch_id() would check this hash in addition to the return value of get_sha1() (and ignore the note if the version/diff options differ).

If you are following git.git slavishly, maybe hashing just the major/minor Git version would be in order to avoid frequent regeneration of identical patch IDs.

> And quite frankly, if you do rebases etc so much that you think patch
> ID's are so important that they need to be cached, you may be doing
> odd/wrong things.

AFAICT John actually gave a very valid scenario that validates his use case: git-gui patches are best tested in the git.git scenario but have to be contributed via git-gui.git. It's not John's fault that this typically requires a lot of rebasing between vastly divergent histories.

John, do you think you can incorporate that "finger-print" of the patch ID generation and store it in the same note?

Ciao, Johannes

Previous: Linus TorvaldsNext: John Keeping
Message 5 of 18 in “patch-ids.c: cache patch IDs in a notes tree”
  1. patch-ids.c: cache patch IDs in a notes treeJohn Keeping, May 11, 2013
  2. Linus TorvaldsMay 11, 2013
  3. John KeepingMay 11, 2013
  4. Linus TorvaldsMay 11, 2013
  5. Johannes SchindelinMay 11, 2013
  6. John KeepingMay 12, 2013
  7. patch-ids: cache patch IDs in a notes treeJohn Keeping, May 12, 2013
  8. John KeepingMay 12, 2013
  9. Junio C HamanoMay 12, 2013
  10. John KeepingMay 12, 2013
  11. Junio C HamanoMay 12, 2013
  12. John KeepingMay 13, 2013
  13. Junio C HamanoMay 13, 2013
  14. John KeepingMay 13, 2013
  15. Junio C HamanoMay 13, 2013
  16. John KeepingMay 13, 2013
  17. Junio C HamanoMay 13, 2013
  18. John KeepingMay 13, 2013

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.