Skip to content
Commits on Aug 13, 2010
  1. @drafnel @gitster

    git-rebase--interactive.sh: use printf instead of echo to print commi…

    drafnel committed with gitster
    …t message
    
    Replace the echo statements that operate on $rest with printf's to restore
    what was lost from 938791c.  This avoids any mangling that XSI-conformant
    echo's may introduce.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @drafnel @gitster

    git-rebase--interactive.sh: rework skip_unnecessary_picks

    drafnel committed with gitster
    Commit cd035b1 introduced the exec command to interactive rebase.  In
    doing so, it modified the way that skip_unnecessary_picks iterates through
    the list of rebase commands so that it avoided collapsing multiple spaces
    into a single space.  This is necessary for example if the argument to the
    exec command contains a path with multiple spaces in it.
    
    The way it did this was by reading each line of rebase commands into a
    single variable, and then breaking the individual components out using
    echo, sed, and cut.  It used the individual broken-out components for
    decision making, and was still able to write the original line to the
    output file from the variable it had saved it in.  But, since we only
    really need to look at anything other than the first element of the line
    when a 'pick' command is encountered, and even that is only necessary when
    we are still searching for "unnecessary" picks, and since newer rebase
    commands like 'exec' may not even require a sha1 field, let's make our read
    statement parse its input into a "command" variable, and a "rest" variable,
    and then only break out the sha1 from $rest, and call git-rev-parse, when
    absolutely necessary.
    
    I think this future proofs this subroutine, avoids calling git-rev-parse
    unnecessarily, and possibly with bogus arguments, and still accomplishes
    the goal of not mangling the $rest of the rebase command.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 26, 2010
  1. @drafnel @gitster

    git-rebase--interactive.sh: use printf instead of echo to print commi…

    drafnel committed with gitster
    …t message
    
    On systems with an echo which defaults to the XSI-conformant behavior
    (Solaris, or others using Ksh), echo will interpret certain backslashed
    characters as control sequences.  This can cause a problem for interactive
    rebase when it is used to rebase commits whose commit "subject" (the first
    line) contains any of these backslashed sequences.  In this case, echo will
    substitute the control sequence for the backslashed characters and either
    the rebased commit message will differ from the original, or the rebase
    process will fail.  Neither is desirable.
    
    So work around this issue by replacing the echo statements used to print
    out portions of the commit message, with printf.
    
    Also, add a test to test for this breakage.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Acked-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Something went wrong with that request. Please try again.