Re: [PATCH v3 5/7] worktree: teach `list --porcelain` to annotate locked worktree

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

 



Phillip Wood <phillip.wood123@xxxxxxxxx> writes:

> l.starts_with("locked ")
> rather than having to do
> l.starts_with("locked ") || l == "locked\n"

l.regexp_matches("^locked[\s\n]")?

Jokes aside, isn't the "space separated list" meant to be used more
like:

    attrs = l.splitAtEach(" ")
    if "locked" in attrs:
	... yeah it is locked ...
    if "broken" in attrs:
	... ouch, it is broken ...

so I am not sure if having always a trailing whitespace is a good
idea to begin with (the last element may become an empty string if
the splitting is done naively).




[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