]> git.ipfire.org Git - thirdparty/git.git/commit
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)
commitc72fc40d0904cbf3199258c2f471c2351e024b1e
treef5a673af242d74fe738ee6dd0318e343e5eb7ce8
parent8a64881b44e03264fb0c3c26fc00a01c12cd67ff
path.c: clarify two field names in 'struct common_dir'

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>
path.c