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

Re: [PATCH] t3400 (rebase): add failing test for a peculiar rev spec

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 18, 2013, 16:39 UTC
Message-ID
<7vmwsv94jo.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1366275155-26244-1-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
> 'git rebase' does not recognize revisions specified as :/text.  This
> is because the attempts to rev-parse ${REV}^0, which fails in this
> case.  Add a test to document this failure.
Show 5 quoted lines
>  - The failure occurs in git-rebase.sh:403.  Is it using the ^0 only
>    to make sure that the revision specified is a commit?  Surely,
>    there'a a better way to do this?
>
>  Can someone point me in the right direction?
How about ${REV}^0 into
	nREV=$(git rev-parse "${REV}")^0
and use it where you need an object name that needs to be parsed by
get_sha1(), e.g.
	
	git checkout -q "$nREV^0"
I would suggest a helper function in git-sh-setup, something like:
	peel_committish () {
		case "$1" in
                :/*)	
			peeltmp=$(git rev-parse --verify "$1") &&
                	git rev-parse --verify "$peeltmp^0"
                        ;;
		*)
			git rev-parse --verify "$1^0"
                        ;;
		esac
	}
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 2 of 6 in “t3400 (rebase): add failing test for a peculiar rev spec”
  1. t3400 (rebase): add failing test for a peculiar rev specRamkumar Ramachandra, Apr 18, 2013
  2. Junio C HamanoApr 18, 2013
  3. Ramkumar RamachandraApr 19, 2013
  4. Junio C HamanoApr 19, 2013
  5. Junio C HamanoApr 19, 2013
  6. Junio C HamanoApr 19, 2013

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.