All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Gerst <bgerst@didntduck.org>
To: Petr Baudis <pasky@suse.cz>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Cogito: Use git-rev-parse instead of cg-Xnormid.
Date: Sun, 03 Jul 2005 08:25:09 -0400	[thread overview]
Message-ID: <42C7D925.2070007@didntduck.org> (raw)
In-Reply-To: <20050703065920.GA11765@pasky.ji.cz>

Petr Baudis wrote:
> Dear diary, on Sun, Jul 03, 2005 at 07:59:42AM CEST, I got a letter
> where Brian Gerst <bgerst@didntduck.org> told me that...
> 
>>Use git-rev-parse instead of cg-Xnormid.  This allows Cogito to work 
>>properly with packed objects.
>>
>>Signed off by: Brian Gerst <bgerst@didntduck.org>
> 
> 
> But git-rev-parse sucks. It won't detect invalid IDs (--revs-only?), and
> does not support short object IDs (that's a must, it's tremendously
> useful). You need to add that for it to be useful first.

cg-Xnormid is terminally broken in the presence of packed files, since 
it cannot look into them to find objects.  Moreover, many uses of 
commit-id in the scripts can be eliminated because the underlying git 
commands can already understand tags directly, and will check for 
invalid ids then.  The only thing missing is the short id matching.

> 
> 
>>diff --git a/tree-id b/tree-id
>>--- a/tree-id
>>+++ b/tree-id
>>@@ -5,8 +5,8 @@
>> #
>> # Takes ID of the appropriate commit, defaults to HEAD.
>> 
>>-id="$1"
>>-normid=$(${COGITO_LIB}cg-Xnormid "$id") || exit 1
>>+id="${1:-HEAD}"
>>+normid=$(git-rev-parse "$id")
>> type=$(git-cat-file -t "$normid")
>> 
>> if [ "$type" = "commit" ]; then
> 
> 
> This is broken too. You need to be able to pass _tree_ ID to tree-id too,
> not just commit ID. Hmm, or is git-rev-parse able to process any ids?
> Then it's terribly misnamed too. :-) A comment would be useful in that
> case. (Or better a patch to rename it.)

Yes you can still pass in the tree id.

--
				Brian Gerst

  reply	other threads:[~2005-07-03 12:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-03  5:59 [PATCH] Cogito: Use git-rev-parse instead of cg-Xnormid Brian Gerst
2005-07-03  6:59 ` Petr Baudis
2005-07-03 12:25   ` Brian Gerst [this message]
2005-07-03 15:41     ` Petr Baudis
2005-07-03 15:40       ` Sven Verdoolaege
2005-07-03 22:31         ` Petr Baudis
2005-07-03 22:40       ` Linus Torvalds
2005-07-03 23:03         ` Petr Baudis

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=42C7D925.2070007@didntduck.org \
    --to=bgerst@didntduck.org \
    --cc=git@vger.kernel.org \
    --cc=pasky@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.