<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-rebase--interactive.sh, branch v2.3.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-03-05T21:12:56Z</updated>
<entry>
<title>Merge branch 'ks/rebase-i-abbrev' into maint</title>
<updated>2015-03-05T21:12:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-05T21:12:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aaa90f5f077a2b5da2bb750566bf69b330441e0c'/>
<id>urn:sha1:aaa90f5f077a2b5da2bb750566bf69b330441e0c</id>
<content type='text'>
The insn sheet "git rebase -i" creates did not fully honor
core.abbrev settings.

* ks/rebase-i-abbrev:
  rebase -i: use full object name internally throughout the script
</content>
</entry>
<entry>
<title>rebase -i: use full object name internally throughout the script</title>
<updated>2015-01-22T20:19:47Z</updated>
<author>
<name>Kirill A. Shutemov</name>
<email>kirill.shutemov@linux.intel.com</email>
</author>
<published>2015-01-22T11:50:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=edb72d551128f798f5f43292789cb7c731d1e01f'/>
<id>urn:sha1:edb72d551128f798f5f43292789cb7c731d1e01f</id>
<content type='text'>
In earlier days, the abbreviated commit object name shown to the end
users were generated with hardcoded --abbrev=7; 56895038 (rebase
-i: respect core.abbrev, 2013-09-28) tried to make it honor the user
specified core.abbrev, but it missed the very initial invocation of
the editor.

These days, we try to use the full 40-hex object names internally to
avoid ambiguity that can arise after rebase starts running.  Newly
created objects during the rebase may share the same prefix with
existing commits listed in the insn sheet.  These object names are
shortened just before invoking the sequence editor to present the
insn sheet to the end user, and then expanded back to full object
names when the editor returns.

But the code still used the shortened names when preparing the insn
sheet for the very first time, resulting "7 hexdigits or more"
output to the user.  Change the code to use full 40-hex commit
object names from the very beginning to make things more uniform.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Show number of TODO items for interactive rebase</title>
<updated>2014-12-10T21:17:38Z</updated>
<author>
<name>Onno Kortmann</name>
<email>onno@gmx.net</email>
</author>
<published>2014-12-10T18:16:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=97f05f43dc73f2855eb4c6acd1ea49d6d6bc4bce'/>
<id>urn:sha1:97f05f43dc73f2855eb4c6acd1ea49d6d6bc4bce</id>
<content type='text'>
During 'rebase -i', one wrong edit in a long rebase session
might inadvertently drop commits/items. This change shows
the total number of TODO items in the comments after the
list. After performing the rebase edit, total item counts
can be compared to make sure that no changes have been lost
in the edit.

Signed-off-by: Onno Kortmann &lt;onno@gmx.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rebase: omit patch-identical commits with --fork-point</title>
<updated>2014-07-16T20:07:40Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2014-07-16T19:23:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1e0dacdbdb751caa5936b6d1510f5e8db4d1ed5f'/>
<id>urn:sha1:1e0dacdbdb751caa5936b6d1510f5e8db4d1ed5f</id>
<content type='text'>
When the `--fork-point` argument was added to `git rebase`, we changed
the value of $upstream to be the fork point instead of the point from
which we want to rebase.  When $orig_head..$upstream is empty this does
not change the behaviour, but when there are new changes in the upstream
we are no longer checking if any of them are patch-identical with
changes in $upstream..$orig_head.

Fix this by introducing a new variable to hold the fork point and using
this to restrict the range as an extra (negative) revision argument so
that the set of desired revisions becomes (in fork-point mode):

	git rev-list --cherry-pick --right-only \
		$upstream...$orig_head ^$fork_point

This allows us to correctly handle the scenario where we have the
following topology:

	    C --- D --- E  &lt;- dev
	   /
	  B  &lt;- master@{1}
	 /
	o --- B' --- C* --- D*  &lt;- master

where:
- B' is a fixed-up version of B that is not patch-identical with B;
- C* and D* are patch-identical to C and D respectively and conflict
  textually if applied in the wrong order;
- E depends textually on D.

The correct result of `git rebase master dev` is that B is identified as
the fork-point of dev and master, so that C, D, E are the commits that
need to be replayed onto master; but C and D are patch-identical with C*
and D* and so can be dropped, so that the end result is:

	o --- B' --- C* --- D* --- E  &lt;- dev

If the fork-point is not identified, then picking B onto a branch
containing B' results in a conflict and if the patch-identical commits
are not correctly identified then picking C onto a branch containing D
(or equivalently D*) results in a conflict.

This change allows us to handle both of these cases, where previously we
either identified the fork-point (with `--fork-point`) but not the
patch-identical commits *or* (with `--no-fork-point`) identified the
patch-identical commits but not the fact that master had been rewritten.

Reported-by: Ted Felix &lt;ted@tedfelix.com&gt;
Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ep/avoid-test-a-o'</title>
<updated>2014-06-25T19:23:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-06-25T19:23:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e56857246adbd3ab0ded490f300da8ef34374cbc'/>
<id>urn:sha1:e56857246adbd3ab0ded490f300da8ef34374cbc</id>
<content type='text'>
Update tests and scripts to avoid "test ... -a ...", which is often
more error-prone than "test ... &amp;&amp; test ...".

Squashed misconversion fix-up into git-submodule.sh updates.

* ep/avoid-test-a-o:
  git-submodule.sh: avoid "echo" path-like values
  git-submodule.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  t/test-lib-functions.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  t/t9814-git-p4-rename.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  t/t5538-push-shallow.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  t/t5403-post-checkout-hook.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  t/t5000-tar-tree.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  t/t4102-apply-rename.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  t/t0026-eol-config.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  t/t0025-crlf-auto.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  t/lib-httpd.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  git-rebase--interactive.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  git-mergetool.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  git-bisect.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  contrib/examples/git-resolve.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  contrib/examples/git-repack.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  contrib/examples/git-merge.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  contrib/examples/git-commit.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  contrib/examples/git-clone.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
  check_bindir: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"
</content>
</entry>
<entry>
<title>Merge branch 'rr/rebase-autostash-fix'</title>
<updated>2014-06-16T17:06:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-06-16T17:06:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4a43d4f98a1a6a472ce1e87c64cb6df0d1653d02'/>
<id>urn:sha1:4a43d4f98a1a6a472ce1e87c64cb6df0d1653d02</id>
<content type='text'>
* rr/rebase-autostash-fix:
  rebase -i: test "Nothing to do" case with autostash
  rebase -i: handle "Nothing to do" case with autostash
</content>
</entry>
<entry>
<title>git-rebase--interactive.sh: avoid "test &lt;cond&gt; -a/-o &lt;cond&gt;"</title>
<updated>2014-06-09T21:47:07Z</updated>
<author>
<name>Elia Pinto</name>
<email>gitter.spiros@gmail.com</email>
</author>
<published>2014-06-06T14:55:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e425f6ad4d14d49fee09712af0aa6f56037e7dd7'/>
<id>urn:sha1:e425f6ad4d14d49fee09712af0aa6f56037e7dd7</id>
<content type='text'>
The construct is error-prone; "test" being built-in in most modern
shells, the reason to avoid "test &lt;cond&gt; &amp;&amp; test &lt;cond&gt;" spawning
one extra process by using a single "test &lt;cond&gt; -a &lt;cond&gt;" no
longer exists.

Signed-off-by: Elia Pinto &lt;gitter.spiros@gmail.com&gt;
Reviewed-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rebase -i: handle "Nothing to do" case with autostash</title>
<updated>2014-05-19T22:36:24Z</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>artagnon@gmail.com</email>
</author>
<published>2014-05-19T22:05:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e4244eb3957d478ca05b42d8b56aadb9ab2bc7ae'/>
<id>urn:sha1:e4244eb3957d478ca05b42d8b56aadb9ab2bc7ae</id>
<content type='text'>
When a user invokes

  $ git rebase -i @~3

with dirty files and rebase.autostash turned on, and exits the $EDITOR
with an empty buffer, the autostash fails to apply. Although the primary
focus of rr/rebase-autostash was to get the git-rebase--backend.sh
scripts to return control to git-rebase.sh, it missed this case in
git-rebase--interactive.sh. Since this case is unlike the other cases
which return control for housekeeping, assign it a special return status
and handle that return value explicitly in git-rebase.sh.

Reported-by: Karen Etheridge &lt;ether@cpan.org&gt;
Signed-off-by: Ramkumar Ramachandra &lt;artagnon@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'km/avoid-non-function-return-in-rebase'</title>
<updated>2014-04-21T17:42:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-04-21T17:42:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0b17b4331087224883878e49342037bf69717b62'/>
<id>urn:sha1:0b17b4331087224883878e49342037bf69717b62</id>
<content type='text'>
Work around /bin/sh that does not like "return" at the top-level
of a file that is dot-sourced from inside a function definition.

* km/avoid-non-function-return-in-rebase:
  Revert "rebase: fix run_specific_rebase's use of "return" on FreeBSD"
  rebase: avoid non-function use of "return" on FreeBSD
</content>
</entry>
<entry>
<title>rebase: avoid non-function use of "return" on FreeBSD</title>
<updated>2014-04-17T17:13:29Z</updated>
<author>
<name>Kyle J. McKay</name>
<email>mackyle@gmail.com</email>
</author>
<published>2014-04-11T08:28:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9f50d32b9c20cc94b9882484ca9704af332a5622'/>
<id>urn:sha1:9f50d32b9c20cc94b9882484ca9704af332a5622</id>
<content type='text'>
Since a1549e10, 15d4bf2e and 01a1e646 (first appearing in v1.8.4)
the git-rebase--*.sh scripts have used a "return" to stop execution
of the dot-sourced file and return to the "dot" command that
dot-sourced it.  The /bin/sh utility on FreeBSD however behaves
poorly under some circumstances when such a "return" is executed.

In particular, if the "dot" command is contained within a function,
then when a "return" is executed by the script it runs (that is not
itself inside a function), control will return from the function
that contains the "dot" command skipping any statements that might
follow the dot command inside that function.  Commit 99855ddf (first
appearing in v1.8.4.1) addresses this by making the "dot" command
the last line in the function.

Unfortunately the FreeBSD /bin/sh may also execute some statements
in the script run by the "dot" command that appear after the
troublesome "return".  The fix in 99855ddf does not address this
problem.

For example, if you have script1.sh with these contents:

run_script2() {
        . "$(dirname -- "$0")/script2.sh"
        _e=$?
        echo only this line should show
        [ $_e -eq 5 ] || echo expected status 5 got $_e
        return 3
}
run_script2
e=$?
[ $e -eq 3 ] || { echo expected status 3 got $e; exit 1; }

And script2.sh with these contents:

if [ 5 -gt 3 ]; then
        return 5
fi
case bad in *)
        echo always shows
esac
echo should not get here
! :

When running script1.sh (e.g. '/bin/sh script1.sh' or './script1.sh'
after making it executable), the expected output from a POSIX shell
is simply the single line:

only this line should show

However, when run using FreeBSD's /bin/sh, the following output
appears instead:

should not get here
expected status 3 got 1

Not only did the lines following the "dot" command in the run_script2
function in script1.sh get skipped, but additional lines in script2.sh
following the "return" got executed -- but not all of them (e.g. the
"echo always shows" line did not run).

These issues can be avoided by not using a top-level "return" in
script2.sh.  If script2.sh is changed to this:

main() {
        if [ 5 -gt 3 ]; then
                return 5
        fi
        case bad in *)
                echo always shows
        esac
        echo should not get here
        ! :
}
main

Then it behaves the same when using FreeBSD's /bin/sh as when using
other more POSIX compliant /bin/sh implementations.

We fix the git-rebase--*.sh scripts in a similar fashion by moving
the top-level code that contains "return" statements into its own
function and then calling that as the last line in the script.

Signed-off-by: Kyle J. McKay &lt;mackyle@gmail.com&gt;
Acked-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
