git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] pull: drop confusing prefix parameter of die_on_unclean_work_tree()

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 14, 2016, 17:11 UTC
Message-ID
<xmqqbn6hassu.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqqfuvtav5k.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
> For the purpose of letting "git pull --rebase" make sure that there
> is no difference between the index and the working tree, we'd want a
> tree-wide diff, so we do not want to limit the diff with pathspec.
> Not passing "prefix" to init_revisions() _is_ the right thing.

Oh, sorry, I think it is me who uses confusing phrasing, not your reading skills. What I meant by the above was:

 - We do want tree-wide diff.
 - We do not want to limit to a subtree.
 - Passing prefix to init_revisions() mean "if we have pathspec,
   they are relative to this prefix".
 - That may hint to the reader that the diff we are going to run may
   be limited to some subset to the tree, which is not what we are
   doing.
 - Hence, we should pass NULL to init_revisions() to make it
   explicit that we are not limiting.
 - And the part of your patch to pass NULL to init_revisions() is
   correct.

But the function itself should take prefix, even if it is not going to use it to call init_revisions(), because it makes it possible to do a better reporting later.

Previous: Junio C Hamano
Message 6 of 6 in “pull: drop confusing prefix parameter of die_on_unclean_work_tree()”
  1. pull: drop confusing prefix parameter of die_on_unclean_work_tree()Johannes Schindelin, Mar 10, 2016
  2. Junio C HamanoMar 10, 2016
  3. Junio C HamanoMar 10, 2016
  4. Johannes SchindelinMar 14, 2016
  5. Junio C HamanoMar 14, 2016
  6. Junio C HamanoMar 14, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.