Re: [RFC PATCH v2 09/13] walken: demonstrate reversing a revision walk list

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

 



On Wed, Jun 26, 2019 at 7:51 PM Emily Shaffer <emilyshaffer@xxxxxxxxxx> wrote:
> The final installment in the tutorial about sorting revision walk
> outputs. This commit reverses the commit list, so that we see newer
> commits last (handy since we aren't using a pager).
>
> It's important to note that rev->reverse needs to be set after
> add_head_to_pending() or before setup_revisions(). (This is mentioned in
> the accompanying tutorial.)

This leaves the reader wondering "why that requirement?". Is it
because those functions may change the value or otherwise depend upon
the value?

Also, something this important probably deserves an in-code comment
(and need not be mentioned in the commit message if the in-code
comment explains it well.)

> Signed-off-by: Emily Shaffer <emilyshaffer@xxxxxxxxxx>
> ---
> diff --git a/builtin/walken.c b/builtin/walken.c
> @@ -69,6 +69,9 @@ static void final_rev_info_setup(int argc, const char **argv, const char *prefix
>         /* add the HEAD to pending so we can start */
>         add_head_to_pending(rev);
> +
> +       /* Reverse the order */
> +       rev->reverse = 1;



[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]

  Powered by Linux