git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rev-parse vs. rev-list --no-walk
@ 2010-05-01 18:35 Michael J Gruber
  2010-05-01 20:05 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Michael J Gruber @ 2010-05-01 18:35 UTC (permalink / raw)
  To: Git Mailing List

In connection with an upcoming RFD patch, I noticed that rev-parse and
rev-list --no-walk do very similar things (OK - I knew *that* already)
in different ways. In particular, rev-list uses the ordinary
setup_revision() which is used in many other places, whereas rev-parse
does it's own thing.

rev-parse does a couple more things, of course, but why doesn't it use
setup_revision() ? I just wanted to ask before trying to restructure
things....

As it is we have the maintenance burden of keeping both rev option
parsers in sync. And, in fact, they are not:

- setup_revision() (and thus rev-list) explicitly adds HEAD for "--all",
rev-parse does not

- setup_revision() outputs each sha1 only once, rev-parse possibly
multiple times (in case of coinciding heads/tags...)

Of course, rev-parse and rev-list --no-walk do actually very different
things, as one can see from the results of "--tags" on both (partially
answering my own question here). And that difference is intentional. So:

- Should setup_revision() really add HEAD on --all? (Probably yes.) In
this case I'd adjust the doc.

- Shouldn't rev-parse --all add HEAD as well?

- Is there any way to use setup_revision() without resolving tags to
commits etc. (and thus using it for rev-parse)?

Michael

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-03 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-01 18:35 rev-parse vs. rev-list --no-walk Michael J Gruber
2010-05-01 20:05 ` Junio C Hamano
2010-05-03 15:22   ` Jay Soffian
2010-05-03 15:50     ` Michael J Gruber

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).