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

Re: [PATCH 08/10] revert: Introduce HEAD, TODO files to persist state, plan

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 1, 2011, 15:28 UTC
Message-ID
<BANLkTino5gmfXjeOVih7+LHcMu1usPWAoQ@mail.gmail.com>
In-Reply-To
<20110526161102.GC24931@elie>
Hi Jonathan and others,
Jonathan Nieder writes:
Show 24 quoted lines
> Ramkumar Ramachandra wrote:
> Almost there.  To comfort overly-worried people like me that think we
> have not finished converted all die() calls yet, wouldn't this need to
> look like
>
>        persist_head(head);
>        while ((commit = ...)) {
>                int status_or_error;
>
>                /*
>                 * Checkpoint.  If do_pick_commit exits, make sure the user
>                 * can still use "git cherry-pick --continue" to recover.
>                 */
>                persist_todo(revs.commits, opts);
>
>                status_or_error = do_pick_commit(...);
>                if (status_or_error)
>                        return status_or_error;
>        }
>
>        /* Success! */
>        remove_todo(opts);
>        remove_head();
>        return 0;

It's a little embarrassing, but I'm not able to figure out how to persist the TODO early. prepare_revs() sets up the revision walker and populates the rev_info struct: it contains a commit_list * in its commits member, but I apparently can't access those directly -- I went through some literature about revision walking and inspected how get_revision must be used to iterate over all the individual commits. Now, to persist the TODO, I need a commit_list to use: is there some API I can use to avoid iterating over all the commits twice? Once to populate the commit_list to persist the TODO, and the second time to actually pick them?

Thanks.
-- Ram
Previous: Junio C HamanoNext: Jonathan Nieder
Message 29 of 37 in “Sequencer Foundations”
  1. 00/10 Sequencer FoundationsRamkumar Ramachandra, May 25, 2011
  2. 01/10 advice: Introduce error_resolve_conflictRamkumar Ramachandra, May 25, 2011
  3. 02/10 revert: Propogate errors upwards from do_pick_commitRamkumar Ramachandra, May 25, 2011
  4. Junio C HamanoMay 25, 2011
  5. Ramkumar RamachandraMay 26, 2011
  6. 03/10 revert: Eliminate global "commit" variableRamkumar Ramachandra, May 25, 2011
  7. Junio C HamanoMay 25, 2011
  8. 04/10 revert: Rename no_replay to record_originRamkumar Ramachandra, May 25, 2011
  9. 05/10 revert: Introduce struct to keep command-line optionsRamkumar Ramachandra, May 25, 2011
  10. 06/10 revert: Separate cmdline parsing from functional codeRamkumar Ramachandra, May 25, 2011
  11. 07/10 revert: Catch incompatible command-line options earlyRamkumar Ramachandra, May 25, 2011
  12. 08/10 revert: Introduce HEAD, TODO files to persist state, planRamkumar Ramachandra, May 25, 2011
  13. 09/10 revert: Implement parsing --continue, --abort and --skipRamkumar Ramachandra, May 25, 2011
  14. 10/10 revert: Implement --abort processingRamkumar Ramachandra, May 25, 2011
  15. Junio C HamanoMay 25, 2011
  16. 00/10 Sequencer FoundationsRamkumar Ramachandra, May 26, 2011
  17. 01/10 advice: Introduce error_resolve_conflictRamkumar Ramachandra, May 26, 2011
  18. 02/10 revert: Propogate errors upwards from do_pick_commitRamkumar Ramachandra, May 26, 2011
  19. 03/10 revert: Eliminate global "commit" variableRamkumar Ramachandra, May 26, 2011
  20. 04/10 revert: Rename no_replay to record_originRamkumar Ramachandra, May 26, 2011
  21. 05/10 revert: Introduce struct to keep command-line optionsRamkumar Ramachandra, May 26, 2011
  22. 06/10 revert: Separate cmdline parsing from functional codeRamkumar Ramachandra, May 26, 2011
  23. 07/10 revert: Catch incompatible command-line options earlyRamkumar Ramachandra, May 26, 2011
  24. 08/10 revert: Introduce HEAD, TODO files to persist state, planRamkumar Ramachandra, May 26, 2011
  25. Jonathan NiederMay 26, 2011
  26. Ramkumar RamachandraMay 26, 2011
  27. Ramkumar RamachandraMay 26, 2011
  28. Junio C HamanoMay 26, 2011
  29. Ramkumar RamachandraJun 1, 2011
  30. Jonathan NiederJun 1, 2011
  31. Ramkumar RamachandraJun 2, 2011
  32. Jeff KingJun 2, 2011
  33. Ramkumar RamachandraJun 8, 2011
  34. 09/10 revert: Implement parsing --continue, --abort and --skipRamkumar Ramachandra, May 26, 2011
  35. 10/10 revert: Implement --abort processingRamkumar Ramachandra, May 26, 2011
  36. Junio C HamanoMay 26, 2011
  37. Ramkumar RamachandraMay 27, 2011

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.