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

[PATCHv2 0/4] refs.c: use transactions for the reflog

From
Stefan Beller <sbeller@google.com>
Date
Dec 2, 2014, 07:46 UTC
Message-ID
<1417506402-24257-1-git-send-email-sbeller@google.com>

This is the core part of the refs-transactions-reflog series[1], which was in discussion for a bit already.

The idea is to have the reflog being part of the transactions, which the refs are already using, so the we're moving towards a database like API in the long run. This makes git easier to maintain as well as opening the possibility to replace the backend with a real database.

The first patch is essentially just some sed magic with reformatting the code, so the naming convention fits better, because the transactions will handle both the refs as well as the reflog after this series.

The second patch is also just a rename patch.

The meat and most of the lines of code are found in the 3rd patch. It was completely rewritten from scratch using ideas provided by Jonathan, thanks! We'll treat the refs and reflogs a bit differently within the transaction updates data structure, as the hard part for the refs is during the commit phase, while the hard part for the reflogs is during the preparation phase now.

We're using a temporary file for creating the new reflog and rename it into place afterwards utilizing the lock file API.

The last patch makes actually use of the reflog transaction API.

Any comments would be appreciated, Thanks, Stefan

Next: Stefan Beller
Message 1 of 12 in “[PATCHv2 0/4] refs.c: use transactions for the reflog”
  1. Stefan BellerDec 2, 2014
  2. 1/4 refs.c: rename the transaction functionsStefan Beller, Dec 2, 2014
  3. Jonathan NiederDec 3, 2014
  4. 2/4 refs.c: rename transaction.updates to transaction.ref_updatesStefan Beller, Dec 2, 2014
  5. Jonathan NiederDec 3, 2014
  6. 3/4 refs.c: add a transaction function to append a reflog entryStefan Beller, Dec 2, 2014
  7. Jonathan NiederDec 3, 2014
  8. Stefan BellerDec 3, 2014
  9. Jonathan NiederDec 3, 2014
  10. 4/4 reflog.c: use a reflog transaction when writing during expireStefan Beller, Dec 2, 2014
  11. Jonathan NiederDec 3, 2014
  12. Junio C HamanoDec 3, 2014

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.