Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-17 Thread Kyle J. McKay
On Apr 17, 2014, at 10:15, Junio C Hamano wrote: I think just the s/from/to/ would fix it so it does not give me the wrong impression, but that doesn't mean that would not confuse everyone else. ;) Yeah, let's do that. Thanks for carefully reading them. I'd think it makes it clearer to sa

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-17 Thread Junio C Hamano
"Kyle J. McKay" writes: > Either "return to the function that dot-sourced us" or "return from > the dot command that dot-sourced us", > but using the original wording > implies to me that the function that dot-sourced us will return as > soon as the dot-sourced script executes the return and tha

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-16 Thread Kyle J. McKay
On Apr 16, 2014, at 11:11, Junio C Hamano wrote: Junio C Hamano writes: "Kyle J. McKay" writes: If I'm the only one getting a wrong meaning from the comments, then no reason to change them. I agree that the description does not read well with the work-around already there. I am not sur

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-16 Thread Junio C Hamano
Junio C Hamano writes: > By the way, you have this in your log message: > > ... the git-rebase--*.sh scripts have used a "return" to return > from the "dot" command that runs them. While this is allowed by > POSIX,... > > > Is it "this is allowed", or is it "this should be the way an

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-16 Thread Junio C Hamano
Junio C Hamano writes: > "Kyle J. McKay" writes: > >> If I'm the only one getting a wrong meaning from the comments, then no >> reason to change them. > > I agree that the description does not read well with the work-around > already there. I am not sure what would be a better way to phrase > i

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-16 Thread Junio C Hamano
"Kyle J. McKay" writes: > On Apr 14, 2014, at 15:51, Junio C Hamano wrote: >> I think we would want to see the actual change formatted this way >> (without needing to pass "-w" to "git show"), as it will make it >> clear that this artificial extra level of "define the whole thing >> inside a func

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-15 Thread Kyle J. McKay
On Apr 14, 2014, at 15:51, Junio C Hamano wrote: I think we would want to see the actual change formatted this way (without needing to pass "-w" to "git show"), as it will make it clear that this artificial extra level of "define the whole thing inside a function and then make a single call to it

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-14 Thread Junio C Hamano
"Kyle J. McKay" writes: > For convenience, here are the diffs using -w: > > |--- a/git-rebase--am.sh > |+++ b/git-rebase--am.sh > |@@ -4,6 +4,7 @@ > # Copyright (c) 2010 Junio C Hamano. > # > > +git_rebase__am() { > case "$action" in > continue) > git am --resolved -

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-14 Thread Junio C Hamano
Matthieu Moy writes: > "Kyle J. McKay" writes: > >> So I suggest that in the interest of fixing rebase on FreeBSD in an >> expeditious fashion, patches 1/3 and 2/3 get picked up (see note >> below) now and that the follow-on patch below, after being enhanced to >> pass all tests, be submit

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-14 Thread Matthieu Moy
"Kyle J. McKay" writes: > So I suggest that in the interest of fixing rebase on FreeBSD in an > expeditious fashion, patches 1/3 and 2/3 get picked up (see note > below) now and that the follow-on patch below, after being enhanced to > pass all tests, be submitted separately at some future

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-12 Thread Kyle J. McKay
On Apr 12, 2014, at 10:07, Matthieu Moy wrote: > "Kyle J. McKay" writes: > >> On Apr 11, 2014, at 10:30, Matthieu Moy wrote: >>> "Kyle J. McKay" writes: >>> There are already nested functions with file inclusion between both levels of nesting in git-rebase--interactive.sh and git-rebase

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-12 Thread Matthieu Moy
"Kyle J. McKay" writes: > On Apr 11, 2014, at 10:30, Matthieu Moy wrote: >> "Kyle J. McKay" writes: >> >>> There are already nested functions with file inclusion between both >>> levels of nesting in git-rebase--interactive.sh and git-rebase-- >>> merge.sh now, so it's not introducing anything n

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-11 Thread Kyle J. McKay
On Apr 11, 2014, at 10:30, Matthieu Moy wrote: "Kyle J. McKay" writes: There are already nested functions with file inclusion between both levels of nesting in git-rebase--interactive.sh and git-rebase-- merge.sh now, so it's not introducing anything new. OK, so it's less serious than I thou

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-11 Thread Matthieu Moy
"Kyle J. McKay" writes: > There are already nested functions with file inclusion between both > levels of nesting in git-rebase--interactive.sh and git-rebase-- > merge.sh now, so it's not introducing anything new. OK, so it's less serious than I thought. But still, we're introducing a function

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-11 Thread Kyle J. McKay
On Apr 11, 2014, at 01:48, Matthieu Moy wrote: "Kyle J. McKay" writes: If script2.sh is changed to this: # script2.sh fixed main() { if [ 5 -gt 3 ]; then return 5 fi case bad in *) echo always shows esac echo should not get here

Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-11 Thread Matthieu Moy
"Kyle J. McKay" writes: > If script2.sh is changed to this: > > # script2.sh fixed > main() { > if [ 5 -gt 3 ]; then > return 5 > fi > case bad in *) > echo always shows > esac > echo should not get here > ! : > } > m

[PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

2014-04-11 Thread Kyle J. McKay
Since a1549e10, 15d4bf2e and 01a1e646 (first appearing in v1.8.4) the git-rebase--*.sh scripts have used a "return" to return from the "dot" command that runs them. While this is allowed by POSIX, the FreeBSD /bin/sh utility behaves poorly under some circumstances when such a "return" is executed.