Branching behavior with dulwich

65 views
Skip to first unread message

Nathan Menge

unread,
Jul 21, 2017, 1:19:30 PM7/21/17
to dulwich-discuss
Hello,
     I guess I should preface this with I am using only the porcelain layer of dulwich so far.  If I need to go into the plumbing then so be it.

     I can see through porcelain how to create a branch, but it does not make it the active branch upon creation.  I don't see a mechanism to do the equivalent of `git checkout -b <branch-name>`.
Or how to do `git checkout <branch-name>`, after the branch is created.

Am I overlooking something in porcelain?

I need to push my newly created branch as well, but I haven't gotten that far, since all my commits are being made on master after I create my branch.


Thanks in advance,
Nathan Menge


Jelmer Vernooij

unread,
Jul 22, 2017, 7:49:49 AM7/22/17
to Nathan Menge, dulwich-discuss
Hi Nathan,

There indeed isn't really a way to do "git checkout -b" with the
porcelain yet. The main blocker for this functionality is
https://github.com/jelmer/dulwich/issues/452 - porcelain currently
doesn't do working tree merges.

For what you're trying to do, just changing the branch (without
merging working tree changes) should be sufficient sufficient - i.e.
"git branch blah". You should be able to just use
dulwich.porcelain.set_symbolic_ref(b"refs/heads/blah") to change the
currently active branch after you have created a branch.

Hope this helps,

Jelmer
> --
> You received this message because you are subscribed to the Google Groups
> "dulwich-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dulwich-discu...@googlegroups.com.
> To post to this group, send email to dulwich...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/dulwich-discuss/bc9dae02-d3f9-4a05-b2ee-3637396e2b32%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages