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

Re: [StGit PATCH 03/14] Write to a stack log when stack is modified

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Jun 18, 2008, 13:03 UTC
Message-ID
<b0943d9e0806180603h59187f7epc5014f36d070cec7@mail.gmail.com>
In-Reply-To
<20080617153247.GA12520@diana.vm.bytemark.co.uk>
2008/6/17 Karl Hasselström <kha@treskal.com>:
Show 16 quoted lines
> On 2008-06-17 15:11:42 +0100, Catalin Marinas wrote:
>
>> 2008/6/17 Karl Hasselström <kha@treskal.com>:
>>
>> > On 2008-06-17 11:24:53 +0100, Catalin Marinas wrote:
>> > > The main question. Is this history preserved after a git-gc?
>> >
>> > Yes. It's stored in a regular git branch. (The design is such that it
>> > should even be possible to pull a stack log from another repository
>> > and _still_ get everything you need.)
>>
>> But how are the patches recreated when undoing (the
>> refs/patches/<branch>/* files)? Using the Bottom/Top tree ids that a
>> patch had in the past? Are these trees still present after a git-gc?
>
> The log actually _contains_ those trees, so there is no problem.

OK, I begin to understand. It is a generic solution for storing metadata but IMHO it is too overweight when we only need a list of applied and unapplied files (we can remove hidden) that could be easily stored in a commit log. It would be useful to run a quick benchmark with many (hundreds) of patches and compare it with no logging variant (or the current patch logging, which isn't as advanced).

Could we not make this (much) simpler? I.e. <branch>.stgit is a commit object whose tree is <branch>^{tree} and the message contains the command followed by list of patches in the form "<commit> <patch>"? This commit can have two parents - the previous <branch>.stgit and current <branch> head. All the patches are referred via the <branch> head or the previous <branch> heads if unapplied (assuming that when a patch is created it is first applied and then popped, maybe this needs a bit of thinking). This way, a diff between subsequent <branch>.stgit commits would show the tree changes. The 'stg log' command could be made to show differences in the commit messages.

Show 10 quoted lines
>> > It shows you diffs between subsequent revisions of the simplified
>> > log. I'm sure it's far from perfect, but I think it's actually
>> > quite useful.
>>
>> It is useful, though it might take a bit of time to get used to it.
>
> Yes, much like diffs take some time to get used to if you haven't seen
> them before.
>
> If you have ideas for a better way to visualize this, I'm all ears.

The diff of diffs is generally useful but for 'refresh' logs, you can show the diff between the old top tree and the new one (the current patch log implementation does something like this but it doesn't show anything for commands like 'push' where a diff of diffs would be more appropriate).

-- 
Catalin
Previous: Karl HasselströmNext: Karl Hasselström
Message 10 of 32 in “Undo series”
  1. 00/14 Undo seriesKarl Hasselström, Jun 12, 2008
  2. 01/14 Fix typoKarl Hasselström, Jun 12, 2008
  3. 02/14 Library functions for tree and blob manipulationKarl Hasselström, Jun 12, 2008
  4. 03/14 Write to a stack log when stack is modifiedKarl Hasselström, Jun 12, 2008
  5. Catalin MarinasJun 17, 2008
  6. Karl HasselströmJun 17, 2008
  7. Karl HasselströmJun 17, 2008
  8. Catalin MarinasJun 17, 2008
  9. Karl HasselströmJun 17, 2008
  10. Catalin MarinasJun 18, 2008
  11. Karl HasselströmJun 18, 2008
  12. Catalin MarinasJun 18, 2008
  13. Karl HasselströmJun 18, 2008
  14. Catalin MarinasJun 19, 2008
  15. Karl HasselströmJun 19, 2008
  16. Catalin MarinasJun 20, 2008
  17. Karl HasselströmJun 23, 2008
  18. Catalin MarinasJul 12, 2008
  19. Karl HasselströmJul 14, 2008
  20. Karl HasselströmJul 1, 2008
  21. Catalin MarinasJul 3, 2008
  22. 04/14 Add utility function for reordering patchesKarl Hasselström, Jun 12, 2008
  23. 05/14 New command: stg resetKarl Hasselström, Jun 12, 2008
  24. 06/14 Log conflicts separatelyKarl Hasselström, Jun 12, 2008
  25. 07/14 Log conflicts separately for all commandsKarl Hasselström, Jun 12, 2008
  26. 08/14 Add a --hard flag to stg resetKarl Hasselström, Jun 12, 2008
  27. 09/14 Don't write a log entry if there were no changesKarl Hasselström, Jun 12, 2008
  28. 10/14 Move stack reset function to a shared locationKarl Hasselström, Jun 12, 2008
  29. 11/14 New command: stg undoKarl Hasselström, Jun 12, 2008
  30. 12/14 New command: stg redoKarl Hasselström, Jun 12, 2008
  31. 13/14 Log and undo external modificationsKarl Hasselström, Jun 12, 2008
  32. 14/14 Make "stg log" show stack log instead of patch logKarl Hasselström, Jun 12, 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.