From: Andreas Ericsson Date: Sun, 27 Nov 2005 23:34:03 GMT Subject: Re: git-send-mail in sh Message-ID: <438A426B.7070607@op5.se> In-Reply-To: <7v4q5xbvip.fsf@assigned-by-dhcp.cox.net> Junio C Hamano wrote: > Andreas Ericsson writes: > >> # single commit >> com1="${com1##*^}" >> range="$com1^1..$com1" >> ;; > > > I wonder if you meant "${com1%^}" here, to remove the trailing '^'. > I did/do/done. :) > >> ?*^[0-9]|?*^[0-9][0-9]) >> # series of commits, ranging back from >> range="$com1..${com1%%^*}" >> ;; >> ^[0-9]|^[0-9][0-9]) >> # series of commits, ranging back from HEAD >> range="HEAD$com1..HEAD" >> ;; > > > N generation back in extended SHA1 notation uses a tilde '~', I just noticed that after sending the original email. I've changed it to take tilde instead. > Also limiting to between 0 and 99 > generations misinterprets "HEAD~123". > > Although checking only the letter that follows the tilde is a > digit mistakenly accepts something like "master~1-bad-one", that > is already malformed and whatever comes downstream would barf, > so that may be fine. How about something like: > > ?*'~'[1-9]*) > range="$com1..${com1%~*}" ;; > '~'[1-9]*) > range="HEAD$com1..HEAD" ;; > Fine by me, although that 99 patches limit was sort of semi-intentional. Doing it this way makes case order matter since ?*'~'[1-9]* will also match ~3..HEAD I'll stick with your way though and put a comment there so people don't touch the ordering. Thanks for the expr lesson btw. -- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231