W dniu 20.11.2016 o 18:32, Junio C Hamano pisze: > Karthik Nayak <karthik.188@xxxxxxxxx> writes: > >> We could have lstrip and rstrip as you suggested and perhaps make >> it work together too. But I see this going off the scope of this >> series. Maybe I'll follow up with another series introducing these >> features. Since we can currently make do with 'strip=2' I'll drop >> this patch from v8 of this series and pursue this idea after this. > > My primary point was that if we know we want to add "rstrip" later > and still decide not to add it right now, it is OK, but we will > regret it if we named the one we are going to add right now "strip". > That will mean that future users, when "rstrip" is introduced, will > end up having to choose between "strip" and "rstrip" (as opposed to > "lstrip" and "rstrip"), wondering why left-variant is more important > and named without left/right prefix. Another solution would be to implement 'splice=<offset>[,<length>]', where if length is omitted it means to the end; perhaps with special casing (as in Perl) of negative <offset> and/or negative <length>. Or implement POSIX shell expansion: %(parameter%word) - Remove Smallest Suffix Glob Pattern. %(parameter%%word) - Remove Largest Suffix Glob Pattern. %(parameter#word) - Remove Smallest Prefix Pattern. %(parameter##word) - Remove Largest Prefix Pattern. Though this one looks like serious overkill... -- Jakub Narębski