Re: [STGIT][PATCH] new: translate non word characters in patch name to '-'
- From
Hannes Eder <hannes@hanneseder.net>
- Date
- Dec 31, 2008, 08:07 UTC
- Message-ID
- <154e089b0812310007j6642af70v4bfd64b784da8b4c@mail.gmail.com>
- In-Reply-To
- <20081229212119.GA3015@diana.vm.bytemark.co.uk>
On Mon, Dec 29, 2008 at 10:21 PM, Karl Hasselström <kha@treskal.com> wrote:
Show 17 quoted lines
> On 2008-12-29 21:15:44 +0100, Hannes Eder wrote: > >> What about instead of 'fail with an informative message', just issue >> a warning that the name has been mangled. I use pathnames in patch >> names frequently, so this would be very handy. > > Hmm, I'm still skeptical. Programs that try to be too clever all too > often end up just being annoying and unpredictable. > >> I guess some with with more python skills needs to clean that up, >> this is the first stuff I do in python ;). > > The code looks OK -- but as I said, I don't agree with what it's > trying to do. > > There's a small inconsistency: you fail if the name contains "..", but > correct single bad characters.
".." is used to denote patch name ranges [<patch1>..<patch2>] for commands like "stg pop", "stg push", and so forth, therefore I think it is wise to exclude ".." from single patch names [<patch3>].
> And as I recall, stgit.namelength is about the automatically generated > patch names -- there's no limit for the names provided by the user.
Ok.
Maybe we should start defining what a 'valid' patch name has to look like, i.e. define
def is_patch_name_valid(patchname)
Best, Hannes