onlywei / explain-git-with-d3

Use D3 to visualize simple git branching operations.
MIT License
1.71k stars 390 forks source link

Cannot commit to branch with `/` in name #66

Open NTARelix opened 6 years ago

NTARelix commented 6 years ago

Simple Description

I cannot commit to branches with the / character, and I assume there may be other valid git branch names with special characters that might fail in this app.

Reproduction

  1. Start app clean
  2. git checkout -b feat/a
  3. New branch not highlighted, despite the fact that HEAD points to the appropriate commit
  4. git commit
  5. No new commit node in graph and receive the following error in console

    Not a good idea to make commits while in a detached HEAD state.

  6. git checkout -b feat-b
  7. New branch highlighted and HEAD points to appropriate commit
  8. git commit
  9. New node added, branch moved, HEAD follows; all as expected

Expectation

I've seen many orgs that use / in branch names for things like release/9.5, bug/PROD-1234, feat/SOME-9876. Would be nice to allow / in the name and maybe investigate other valid special characters in branch names and allow them.