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

Re: [PATCH v0] fast-import: Add drop command

From
Dmitry Ivankov <divanorama@gmail.com>
Date
Sep 24, 2011, 21:19 UTC
Message-ID
<CA+gfSn8Z7Xn1hdpqNHiP3bd2KGRqcAc6O683Z4O+G=jNNYJtBA@mail.gmail.com>
In-Reply-To
<20110924193733.GB10955@elie>
On Sun, Sep 25, 2011 at 1:37 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 7 quoted lines
> Vitor Antunes wrote:
>
>> The drop command deletes the given branch reference, allowing
>> fast-import to actively ignore it in the final checks.
>
> Thanks.  I must have missed the earlier discussion.  What are the
> semantics of this command and its intended purpose?

My guess is that if fast-import is used to manage a set of "remote" branches, it should be able to delete branches. Then, it should be allowed to do non-fastforward updates too (--force). Why can't it just ignore branches deletion (considering --force)?

Random thoughts:
1. once 'drop' is executed, fast-import can't tell if the branch was
actually deleted. And moreover any attempt to read this branch
head becomes illegal (either it's missing in .git or fast-import is
instructed to use a dropped branch).
2. 'reset' command is a bit like proposed 'drop' but it never deletes
a branch ref. Consider following imports:
1) import branch topic
2) reset topic
3) import branch topic2 starting at topic (incorrect import)
If 1-3) is done in one fast-import process, the error is reported.
If 3) is done separately, it succeeds but the result is strange:
topic2 isn't started from scratch but from old "erased" topic.
So, maybe, reset should be fixed to erase branches on --force.
One more scenario is:
1) import topic
2) reset topic
3) import topic
If 1-3) go together - no error
If 3) goes separate - no error, but non-fastforward update.
Much more harmless, but still may look strange.
> For example, what
> happens if the branch already existed or if there is a checkpoint
> (perhaps triggered by the impatient user sending SIGUSR1 to
> fast-import) before the "drop" command is processed?

I think that actual ref deletion should take place in update_branch(). So all the cases would be handled as usual.

> Jonathan
>
Previous: Jonathan NiederNext: Vitor Antunes
Message 4 of 15 in “fast-import: Add drop command”
  1. fast-import: Add drop commandVitor Antunes, Sep 24, 2011
  2. fast-import: Add drop commandVitor Antunes, Sep 24, 2011
  3. Jonathan NiederSep 24, 2011
  4. Dmitry IvankovSep 24, 2011
  5. Vitor AntunesSep 27, 2011
  6. Vitor AntunesOct 24, 2011
  7. Sverre RabbelierOct 24, 2011
  8. Vitor AntunesOct 25, 2011
  9. Sverre RabbelierOct 27, 2011
  10. Vitor AntunesOct 27, 2011
  11. Sverre RabbelierOct 27, 2011
  12. Vitor AntunesNov 9, 2011
  13. Sverre RabbelierNov 9, 2011
  14. Vitor AntunesNov 9, 2011
  15. Vitor AntunesSep 24, 2011

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.