Re: [GIT PULL] sh updates for 2.6.25
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Apr 16, 2008, 20:17 UTC
- Message-ID
- <alpine.LFD.1.00.0804161312330.2879@woody.linux-foundation.org>
- In-Reply-To
- <7vve2hpnz1.fsf@gitster.siamese.dyndns.org>
On Wed, 16 Apr 2008, Junio C Hamano wrote:
Show 17 quoted lines
> > > @@ -388,6 +383,7 @@ do > > ;; > > esac > > esac > > + FIRSTLINE=$(head -1 "$dotest/final-commit") > > > > resume= > > if test "$interactive" = t > > @@ -408,7 +404,6 @@ do > > [aA]*) action=yes interactive= ;; > > [nN]*) action=skip ;; > > [eE]*) git_editor "$dotest/final-commit" > > - SUBJECT=$(reread_subject "$dotest/final-commit") > > This needs to be replaced with re-assignment to FIRSTLINE, as the user may > have fixed the title in the editor; otherwise...
Hmm. I think we could just have moved the assignment of FIRSTLINE it down, and had it in just one place. I see you already fixed it up, but maybe a patch like this is still a worthy cleanup.
That said - I didn't check that there isn't some subtle intermediate user or a break out of the loop or something. So while this patch _looks_ obvious and passes the tests, I'm not going to guarantee that there isn't some special case. I doubt any of the tests really check things like the reflog comments after git-am etc..
Linus
--- git-am.sh | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/git-am.sh b/git-am.sh index 245e1db..9a865cc 100755 --- a/git-am.sh +++ b/git-am.sh @@ -383,7 +383,6 @@ do ;; esac esac - FIRSTLINE=$(head -1 "$dotest/final-commit") resume= if test "$interactive" = t @@ -404,7 +403,6 @@ do [aA]*) action=yes interactive= ;; [nN]*) action=skip ;; [eE]*) git_editor "$dotest/final-commit" - FIRSTLINE=$(head -1 "$dotest/final-commit") action=again ;; [vV]*) action=again LESS=-S ${PAGER:-less} "$dotest/patch" ;; @@ -427,6 +425,7 @@ do stop_here $this fi + FIRSTLINE=$(head -1 "$dotest/final-commit") printf 'Applying %s\n' "$FIRSTLINE" case "$resolved" in