git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH] t3400 (rebase): add failing test for a peculiar rev spec
Date: Thu, 18 Apr 2013 09:39:23 -0700	[thread overview]
Message-ID: <7vmwsv94jo.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1366275155-26244-1-git-send-email-artagnon@gmail.com> (Ramkumar Ramachandra's message of "Thu, 18 Apr 2013 14:22:35 +0530")

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.

>  - 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
	}

  reply	other threads:[~2013-04-18 16:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18  8:52 [PATCH] t3400 (rebase): add failing test for a peculiar rev spec Ramkumar Ramachandra
2013-04-18 16:39 ` Junio C Hamano [this message]
2013-04-19  7:43   ` Ramkumar Ramachandra
2013-04-19 16:21     ` Junio C Hamano
2013-04-19 17:28       ` Junio C Hamano
2013-04-19 17:53     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vmwsv94jo.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).