Re: [PATCH 2/4] fast-import: define a new option command

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 2/4] fast-import: define a new option command

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:14

"Shawn O. Pearce" [off-list ref] writes:
Sverre Rabbelier [off-list ref] wrote:
quoted
On Thu, Aug 13, 2009 at 10:07, Johannes
Schindelin[off-list ref] wrote:
quoted
... and will import the marks twice?
Ah, you're right :(. What's the best way to do this? Should we dump
any previous marks when importing new ones?
Uh, well, yes.  We shouldn't define :5 if it was in the file that
appeared in the stream, but isn't in the file on the command line.

Worse, what happens if we do this:

  echo "option import-marks=/not/found" \
  | git fast-import --import-marks=my.marks

I want this to work, even though /not/found does not exist, but
my.marks does.  So that does complicate things...
How about making the option parser get and keep the _name_ of the file
until option parsing session (i.e. read the stream until initial run of
"option" command runs out and then parse the command line to override),
and then finally open the file and read it?

Re: [PATCH 2/4] fast-import: define a new option command

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:47:14

Heya,

On Thu, Aug 13, 2009 at 12:26, Junio C Hamano[off-list ref] wrote:
How about making the option parser get and keep the _name_ of the file
until option parsing session (i.e. read the stream until initial run of
"option" command runs out and then parse the command line to override),
and then finally open the file and read it?
On Thu, Aug 13, 2009 at 10:44, Sverre Rabbelier[off-list ref] wrote:
Ah, then how about in option_import_marks() we only store the name of
the file, like in option_export_marks, and at the end, when we reach
the first non-option command (and we've parsed argv), we read the
file. That way it's only read once, and it deals with the above
scenario.
Which is exactly what the latest version does :).

-- 
Cheers,

Sverre Rabbelier
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help