git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] fast-import: disallow empty branches as parents
@ 2012-06-20 19:34 Dmitry Ivankov
  2012-06-20 19:34 ` [PATCH] " Dmitry Ivankov
  2012-06-25  8:00 ` [PATCH/RFC] " Dmitry Ivankov
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitry Ivankov @ 2012-06-20 19:34 UTC (permalink / raw)
  To: git; +Cc: Jonathan Nieder, Jeff King, Sverre Rabbelier, Dmitry Ivankov

Combinations of "reset", "commit" with "from" and/or "merge" commands
may make fast-import to produce bad objects (null_sha1 parents) or
accept bad inputs (ones asking for empty branches as parents).

Fix this and add some tests.


One RFC here: does following use case make any sense/should it be allowed?

    commit refs/heads/master
    ...
    from something
    merge refs/heads/master

1. If "from" is omitted or equals refs/heads/master we end up with duplicated parents.
2. And if something is not master we allow to pick a new first parent path.

"2" seems quite legal, while "1" looks worse. Though "1" is not directly related to
this patch and can be reproduced via a simple "merge X X" command for example.


Dmitry Ivankov (1):
  fast-import: disallow empty branches as parents

 fast-import.c          |   49 +++++++++++++++++++++++++++++------------------
 t/t9300-fast-import.sh |   48 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+), 19 deletions(-)

-- 
1.7.3.4

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

end of thread, other threads:[~2012-06-25  8:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-20 19:34 [PATCH/RFC] fast-import: disallow empty branches as parents Dmitry Ivankov
2012-06-20 19:34 ` [PATCH] " Dmitry Ivankov
2012-06-21  3:57   ` Jonathan Nieder
2012-06-21  6:39     ` Dmitry Ivankov
2012-06-25  8:00 ` [PATCH/RFC] " Dmitry Ivankov

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