On Wed, 31 Oct 2012, Felipe Contreras wrote: > Hi, > > On Wed, Oct 31, 2012 at 7:59 PM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote: > > Felipe Contreras wrote: > >> On Wed, Oct 31, 2012 at 7:20 PM, Johannes Schindelin > >> <Johannes.Schindelin@xxxxxx> wrote: > > > >>> I just tested this with junio/next and it seems this issue is still > >>> unfixed: instead of > >>> > >>> reset refs/heads/blub > >>> from e7510461b7db54b181d07acced0ed3b1ada072c8 > >>> > >>> I get > >>> > >>> reset refs/heads/blub > >>> from :0 > >>> > >>> when running "git fast-export ^master blub". > >> > >> That is not a problem. It has been discussed extensively, and the > >> consensus seems to be that such command should throw nothing: > >> > >> http://article.gmane.org/gmane.comp.version-control.git/208729 > > > > Um. Are you claiming I have said that "git fast-export ^master blub" > > should silently emit nothing? Or has this been discussed extensively > > with someone else? > > Maybe I misunderstood when you said: > > A patch meeting the above description would make perfect sense to me. > > Anyway, when you have: > > % git fast-export ^next next^{commit} > # nothing > % git fast-export ^next next~0 > # nothing > % git fast-export ^next next~1 > # nothing > % git fast-export ^next next~2 > # nothing > > It only makes sense that: > > % git fast-export ^next next > # nothing > > It doesn't get any more obvious than that. But to each his own. I think that may be true where you have "next" in both places, but I think: $ git checkout -b new-branch master $ git fast-export ^master new-branch ought to emit no "commit" lines, but needs to emit a "reset" line. After all, you haven't told fast-export that the ref "new-branch" is up to date, and you have told it that you want it to be exported. If you create a new branch off of an existing commit, don't change it, and push it to hg, it shouldn't be up to remote-hg to figure out what should happen with no input; it should get a: reset refs/heads/new-branch from [something] I don't know why Johannes seems to want [something] not to be a mark reference (unless he's complaining about getting an invalid mark reference when there aren't any marks defined), but surely something of the above form is necessary to tell remote-hg to create the new branch. I think it would be worth testing that: $ git checkout -b new-branch master $ git push hg new-branch creates the new branch successfully (which I think it does, but wouldn't if "git fast-export ^master new-branch" actually returned nothing; parsed_refs gets it from the reset line). AFAICT, your code relies on getting the behavior that fast-export actually gives, not the behavior you seem to want or the behavior Johannes seems to want. And the reason that you don't need any changes to fast-export is that your process maps marks instead of sha1s. -Daniel *This .sig left intentionally blank* -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html