[PATCH v4 0/2] blame and log: prevent error if range ends past end of file
- From
istephens@atlassian.com <istephens@atlassian.com>
- Date
- Apr 26, 2018, 07:45 UTC
- Message-ID
- <20180426074502.78318-1-istephens@atlassian.com>
- In-Reply-To
- <CAPig+cSH-y7ChDE_LW55M_wB=KhD7uJHXX=OvZ=1ri5KfYQ5Sg@mail.gmail.com>
Picking this back up after a little while. This solution means we can still accept -L, for an empty file but any other range will fail. I've made the change for both blame and log (as two separate patches).
I've also changed behaviour in a couple of corner cases - before we couldn't distinguish between -Ln,-(n+1) and -Ln, so -Ln,-(n+1) would blame from n to the end of the file rather than the first n lines. Also, we now complain that -L,-n is an empty range where previously this would blame the whole file.