Re: [PATCH] Cogito: Use git-rev-parse instead of cg-Xnormid.
- From
Petr Baudis <pasky@suse.cz>
- Date
- Jul 3, 2005, 15:41 UTC
- Message-ID
- <20050703154127.GA31848@pasky.ji.cz>
- In-Reply-To
- <42C7D925.2070007@didntduck.org>
Dear diary, on Sun, Jul 03, 2005 at 02:25:09PM CEST, I got a letter where Brian Gerst <bgerst@didntduck.org> told me that...
Show 16 quoted lines
> 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.
That's right. Well, for everything but the short id matching we could just check the ID validity by git-rev-parse instead of peeking into the object store - I just did that. If I'm not missing anything, that will just make the short id matching for packed objects impossible, but works fine otherwise...?
> 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.
I feel reserved about that. I want to have custom error handling here to give the user less confusing output (no core GIT command name, since that confuses users), and as I said, Cogito's rev resolving is more powerful than Core Git's.
> The only thing missing is the short id matching.
Yes, but as I said, I think it's very important to have. BTW, another cool thing cg-Xnormid does and git-rev-parse does not: time specifiers. E.g. you could specify revisions as "2 days ago" or so, very useful for cg-log, cg-diff and such.
Thanks for pointing this out, BTW.
-- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ <Espy> be careful, some twit might quote you out of context..