]> git.ipfire.org Git - thirdparty/git.git/commitdiff
path.c: clarify two field names in 'struct common_dir'
authorSZEDER Gábor <szeder.dev@gmail.com>
Mon, 21 Oct 2019 16:00:42 +0000 (18:00 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Oct 2019 03:53:51 +0000 (12:53 +0900)
An array of 'struct common_dir' instances is used to specify whether
various paths in $GIT_DIR are specific to a worktree, or are common,
i.e. belong to main worktree.  The names of two fields in this
struct are somewhat confusing or ambigious:

  - The path is recorded in the struct's 'dirname' field, even though
    several entries are regular files e.g. 'gc.pid', 'packed-refs',
    etc.

    Rename this field to 'path' to reduce confusion.

  - The field 'exclude' tells whether the path is excluded...  from
    where?  Excluded from the common dir or from the worktree?  It
    means the former, but it's ambigious.

    Rename this field to 'is_common' to make it unambigious what it
    means.  This, however, means the exact opposite of what 'exclude'
    meant, so we have to negate the field's value in all entries as
    well.

The diff is best viewed with '--color-words'.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

No differences found