Git fork

Merge branch 'mh/left-right-limited'

"git log --{left,right}-only A...B", when A and B does not share
any common ancestor, now behaves as expected.

* mh/left-right-limited:
revision: fix --left/right-only use with unrelated histories

+17
+2
revision.c
··· 2480 2480 die(_("options '%s' and '%s' cannot be used together"), 2481 2481 "--left-only", "--right-only/--cherry"); 2482 2482 revs->left_only = 1; 2483 + revs->limited = 1; 2483 2484 } else if (!strcmp(arg, "--right-only")) { 2484 2485 if (revs->left_only) 2485 2486 die(_("options '%s' and '%s' cannot be used together"), "--right-only", "--left-only"); 2486 2487 revs->right_only = 1; 2488 + revs->limited = 1; 2487 2489 } else if (!strcmp(arg, "--cherry")) { 2488 2490 if (revs->left_only) 2489 2491 die(_("options '%s' and '%s' cannot be used together"), "--cherry", "--left-only");
+15
t/t6000-rev-list-misc.sh
··· 182 182 test_cmp expect actual 183 183 ' 184 184 185 + test_expect_success 'rev-list one-sided unrelated symmetric diff' ' 186 + test_tick && 187 + git commit --allow-empty -m xyz && 188 + git branch cmp && 189 + git rebase --force-rebase --root && 190 + 191 + git rev-list --left-only HEAD...cmp >head && 192 + git rev-list --right-only HEAD...cmp >cmp && 193 + 194 + sort head >head.sorted && 195 + sort cmp >cmp.sorted && 196 + comm -12 head.sorted cmp.sorted >actual && 197 + test_line_count = 0 actual 198 + ' 199 + 185 200 test_expect_success 'rev-list -z' ' 186 201 test_when_finished rm -rf repo && 187 202