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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jonathan and others,

Jonathan Nieder writes:
> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]