]> git.ipfire.org Git - thirdparty/git.git/commit
refs-internal.h: reorganize DO_FOR_EACH_* flag documentation
authorJeff King <peff@peff.net>
Fri, 24 Sep 2021 18:39:44 +0000 (14:39 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Sep 2021 19:36:45 +0000 (12:36 -0700)
commit9aab952e855be1a567d4d0585afbdbde624e274f
tree03d2fd8554577fc92a1f7e53f036b48316baf17f
parentbf708add2eaf37d53fa8a908b5d8772806c54d1b
refs-internal.h: reorganize DO_FOR_EACH_* flag documentation

The documentation for the DO_FOR_EACH_* flags is sprinkled over the
refs-internal.h file. We define the two flags in one spot, and then
describe them in more detail far away from there, in the definitions of
refs_ref_iterator_begin() and ref_iterator_advance_fn().

Let's try to organize this a bit better:

  - convert the #defines to an enum. This makes it clear that they are
    related, and that the enum shows the complete set of flags.

  - combine all descriptions for each flag in a single spot, next to the
    flag's definition

  - use the enum rather than a bare int for functions which take the
    flags. This helps readers realize which flags can be used.

  - clarify the mention of flags for ref_iterator_advance_fn(). It does
    not take flags itself, but is meant to depend on ones set up
    earlier.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
refs/refs-internal.h