git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv2 2/3] parse-remote: support default reflist in get_remote_merge_branch

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 7, 2009, 16:59 UTC
Message-ID
<7vljo49e08.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1244367862-6306-2-git-send-email-santi@agolina.net>
Santi Béjar <santi@agolina.net> writes:
> Expand get_remote_merge_branch to compute the tracking branch to merge
> when called without arguments (or only the remote name). This allows
> "git pull --rebase" without arguments (default upstream branch) to
> work with a rebased upstream.

The last sentence leaves readers wondering... "Ok, with this patch, X without Y now works. What about X _with_ Y? Is it left unfixed? Was it already working before this patch? What is going on???"

> Also add a test to check for this case and another one (failing) to
> test rebasing two branches on top of a rebased upstream using just
> 'git pull --rebase'.
"test doing X using just Y" _sounds as if_ you are implying
	Doing X using Z (that is more cumbersome to type than Y) works but
        doing X using Y (that ought to be the equivalent to Z) does not.
	Let's expose this inconsistent breakage.

without saying what Z is, and/or why Y is preferred. So if that is what is going on, please spell these out.

If that is not the case please drop "just"; it is confusing.
Show 29 quoted lines
> +test_expect_success '--rebase with rebased default upstream' '
> +
> +	git update-ref refs/remotes/me/copy copy-orig &&
> +	git checkout --track -b to-rebase2 me/copy &&
> +	git reset --hard to-rebase-orig &&
> +	git pull --rebase &&
> +	test "conflicting modification" = "$(cat file)" &&
> +	test file = $(cat file2)
> +
> +'
> +
> +test_expect_failure '--rebase with rebased upstream and two branches' '
> +
> +	git update-ref refs/remotes/me/copy copy-orig &&
> +	git reset --hard to-rebase-orig &&
> +	git checkout --track -b to-rebase3 me/copy &&
> +	git reset --hard to-rebase-orig &&
> +	git pull --rebase &&
> +	test "conflicting modification" = "$(cat file)" &&
> +	test file = $(cat file2) &&
> +	git checkout to-rebase2 &&
> +	git pull --rebase me copy
> +
> +'
> +
>  test_expect_success 'pull --rebase dies early with dirty working directory' '
>  
> +	git rebase --abort &&
> +	git checkout to-rebase &&

Hmm, saying "--abort" when rebase is not in progress (i.e. after your next patch fixes the above "expect_failure" to pass) does not error out? It is not very nice...

Show 5 quoted lines
>  	git update-ref refs/remotes/me/copy copy^ &&
>  	COPY=$(git rev-parse --verify me/copy) &&
>  	git rebase --onto $COPY copy &&
> -- 
> 1.6.3.1.308.g426b5
Previous: Santi BéjarNext: Santi Béjar
Message 2 of 3 in “[PATCHv2 2/3] parse-remote: support default reflist in get_remote_merge_branch”
  1. Santi BéjarJun 7, 2009
  2. Junio C HamanoJun 7, 2009
  3. Santi BéjarJun 7, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.