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

Re: [PATCH 2/2] learn to pick/revert into unborn branch

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 23, 2012, 04:02 UTC
Message-ID
<7vlicppg9g.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1356117013-20613-2-git-send-email-martinvonz@gmail.com>
Martin von Zweigbergk <martinvonz@gmail.com> writes:
Show 8 quoted lines
> @@ -435,8 +437,9 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
>  	else
>  		parent = commit->parents->item;
>  
> -	if (opts->allow_ff && parent && !hashcmp(parent->object.sha1, head))
> -		return fast_forward_to(commit->object.sha1, head);
> +	if (opts->allow_ff &&
> +	    (parent && !hashcmp(parent->object.sha1, head) || !parent && unborn))

Style (from GNU); please avoid (A && B || C) and spell the precedence between && and || explicitly, i.e.

	((A && B) || C)
> +	git rm --cached -r . &&
> +	rm -rf * &&
Not "git rm -rf ." and as two separate steps?
Previous: Martin von Zweigbergk
Message 11 of 11 in “tests: move test_cmp_rev to test-lib-functions”
  1. 1/2 tests: move test_cmp_rev to test-lib-functionsMartin von Zweigbergk, Dec 21, 2012
  2. 2/2 learn to pick/revert into unborn branchMartin von Zweigbergk, Dec 21, 2012
  3. Junio C HamanoDec 23, 2012
  4. Martin von ZweigbergkDec 23, 2012
  5. Christian CouderDec 23, 2012
  6. Junio C HamanoDec 23, 2012
  7. Philip OakleyDec 23, 2012
  8. Junio C HamanoDec 23, 2012
  9. Junio C HamanoDec 23, 2012
  10. Martin von ZweigbergkDec 24, 2012
  11. Junio C HamanoDec 23, 2012

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.