Re: [PATCH v4 2/2] rev-parse: add option for absolute or relative path formatting
From: brian m. carlson <hidden>
Date: 2020-12-07 02:39:32
Attachments
- signature.asc [application/pgp-signature] 263 bytes
From: brian m. carlson <hidden>
Date: 2020-12-07 02:39:32
On 2020-12-07 at 00:30:13, Eric Sunshine wrote:
I read the commit message and looked at the implementation so I know
that this option can be specified multiple times, but this
documentation only vaguely hints at it by saying "options following
it". We could do a better job of imparting that knowledge to the
reader by saying so explicitly, perhaps like this:
Controls the behavior of some path-printing options. If
'absolute', [...]. If 'relative', [...]. May be specified multiple
times, each time affecting the path-printing options which
follow it. The default path format is option-specific.I'll improve the documentation in v5.
Since this option can be specified multiple times, should it also recognize `default` to request the default behavior in addition to `absolute` and `relative`? (Genuine question. Maybe real-world use-cases wouldn't need it, but it would be easy to support and make it functionally complete.)
I don't think adding the default is helpful. I can think of situations where people want absolute path names or relative path names, but in what case would someone want, "meh, whatever Git decides to give me"? The problem we're solving here is that Git isn't consistent and can't be used to provide valuable information that the user wants. If a user doesn't care what format the path is in, then they can always specify absolute and it will almost certainly be correct and work for them.
Leaking `realbuf` and `prefixbuf` here.
Will fix. -- brian m. carlson (he/him or they/them) Houston, Texas, US