Re: [PATCH v5 1/4] commit: move reverse_commit_list() from merge-recursive
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Dec 17, 2020, 14:03 UTC
- Message-ID
- <ed765c96-2c19-d5b3-3712-bd6f92eb9b75@gmail.com>
- In-Reply-To
- <9052faeabe62d9ba1b9bceae0c0f7b1809bd1b60.1608157683.git.gitgitgadget@gmail.com>
On 12/16/2020 5:27 PM, Elijah Newren via GitGitGadget wrote:
Show 11 quoted lines
> +struct commit_list *reverse_commit_list(struct commit_list *list)
> +{
> + struct commit_list *next = NULL, *current, *backup;
> + for (current = list; current; current = backup) {
> + backup = current->next;
> + current->next = next;
> + next = current;
> + }
> + return next;
> +}
> +I followed the discussion about the variable names in the earlier thread, and I certainly did not meant to stir a controversy. I think this approach of deduplicating but keeping an exact copy is the best solution.
Thanks, -Stolee