Re: [PATCH] ls-tree: simplify prefix handling

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

 



René Scharfe <l.s.r@xxxxxx> writes:

> git ls-tree has two prefixes: The one handed to cmd_ls_tree(), i.e. the
> current subdirectory in the repository (if any) and the "display" prefix
> used by the show_tree_*() functions.  The option --full-name clears the
> last one, i.e. it shows full paths, and --full-tree clears both, i.e. it
> acts as if the command was started in the root of the repository.

Seeing "there are two" and then "the last one" made me come back to
the beginning to see if I missed the third option, as I am not used
to see the second one among two called "the last", even though it is
logically correct.  "clears the latter", perhaps, as "former vs
latter" is sensible only when there are two, may have avoided my
confusion, but that is minor.

> The show_tree_*() functions use the ls_tree_options members chomp_prefix
> and ls_tree_prefix to determine their prefix values.  Calculate it once
> in cmd_ls_tree() instead, once the main prefix value is finalized.

Very nice observation and simplification.

Thanks.




[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