From: Junio C Hamano <gitster@pobox.com>
To: Sverre Rabbelier <srabbelier@gmail.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>, Jeff King <peff@peff.net>,
Git List <git@vger.kernel.org>,
Daniel Barkalow <barkalow@iabervon.org>
Subject: Re: [PATCH 3/5] setup_revisions: remember whether a ref was positive or not
Date: Sun, 24 Jul 2011 16:17:23 -0700 [thread overview]
Message-ID: <7vr55fs1z0.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vy5znscst.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Sun, 24 Jul 2011 12:23:30 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> Questionable. Did the user mean to say Z is positive when he said
>
> $ git rev-list A B ^C ... --not G H ... ^Z
Having said all that, I think you wanted a way to reconstruct various
different command lines that ends up in the same set of "pending objects",
and I do think that is something we need to address, as our command line
parsing heavily depend on the preprocessing phase of the revision
traversal machinery, and some commands do want to act differently between
the case when they are given "master" vs "master^0" for example (i.e. does
the user mean the branch as a whole or the commit at the tip? If the
former the command may want to do something to the refs/heads/master while
the latter the command may work only on the commit or outright reject the
request saying "I only work on a branch").
In other words, I am not opposed to an effort to give the callers to the
"pending objects" machinery a better way to discover what the user told us
from the command line, giving them more than just "at the end of the
UNINTERESTING marking here are the objects listed on the command line and
you can look at their flags". For example, some commands may want to tell
"a..b" and "^a b" apart, and other commands may want to tell what "a" was
when the user asked for exotic things like "a^@" or "a^!".
It may make sense to change the new "flag" field that can express only one
bit in your implementation to something more descriptive to express "what
command line option did this come from". For example,
git cmd a...b
that calls setup_revisions() may put "a" (positive), "b" (positive), and
zero or more commits that are their merge bases (negative) in pending
objects queue. Right now, these pending object entries may have some part
of the string being parsed as their name, but we may want to annotate all
the object array entries that result from "a...b" with the same "a...b"
(or a structure that represents its parsed form), so that the caller can
notice things like (1) they came from the single command line argument,
(2) the user didn't list random negative commits but they are meant as
merge bases between a and b, (3) a and b were written as such, not as
their abbreviated object names, etc.
Then "git fast-export master..master" can notice that there are two object
array entries in the pending object queue, they came from the same command
line argument, whose parse tree is a "unsymmetric difference between
string 'master' and string 'master'", and take the last piece to convince
itself that the user is talking about the master branch, even though as
the set arithmetic the result is an empty set, and do something
intelligent about the master branch.
next prev parent reply other threads:[~2011-07-24 23:17 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-24 14:21 [PATCH 0/5] fast-export: prepare for remote helpers awesomeness Sverre Rabbelier
2011-07-24 14:21 ` [PATCH 1/5] t9350: point out that refs are not updated correctly Sverre Rabbelier
2011-07-24 14:21 ` [PATCH 2/5] fast-export: do not refer to non-existing marks Sverre Rabbelier
2011-07-24 14:21 ` [PATCH 3/5] setup_revisions: remember whether a ref was positive or not Sverre Rabbelier
2011-07-24 19:23 ` Junio C Hamano
2011-07-24 23:17 ` Junio C Hamano [this message]
2011-08-03 13:52 ` Sverre Rabbelier
2011-08-03 18:12 ` Junio C Hamano
2011-08-08 16:22 ` Johannes Schindelin
2011-08-08 17:47 ` Junio C Hamano
2011-08-08 21:27 ` Sverre Rabbelier
2011-08-08 22:07 ` Junio C Hamano
2011-08-08 22:30 ` Sverre Rabbelier
2011-08-08 22:36 ` Junio C Hamano
2011-08-08 22:38 ` Sverre Rabbelier
2011-08-08 22:46 ` Junio C Hamano
2011-08-08 22:48 ` Sverre Rabbelier
2011-08-08 23:17 ` Junio C Hamano
2011-08-08 23:25 ` Sverre Rabbelier
2011-08-08 23:39 ` Junio C Hamano
2011-08-08 22:24 ` Junio C Hamano
2011-08-08 22:28 ` Sverre Rabbelier
2011-08-08 22:56 ` Junio C Hamano
2011-08-08 23:04 ` Sverre Rabbelier
2011-07-26 15:16 ` Johannes Schindelin
2011-07-24 14:21 ` [PATCH 4/5] fast-export: do not export negative refs Sverre Rabbelier
2011-07-24 19:07 ` Junio C Hamano
2011-07-26 15:11 ` Johannes Schindelin
2011-07-24 14:21 ` [PATCH 5/5] setup_revisions: remember whether a ref was positive or not Sverre Rabbelier
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=7vr55fs1z0.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=peff@peff.net \
--cc=srabbelier@gmail.com \
/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).