I’m writing a small web Git visualization tool and i wanted to convert a file path and a branch:
master repository/folder/test => a39bc19d82890f25df2d08d8bea627bb4354e8d8
mybranch repository/folder/test/myfile.py => 76e2242459d360f7429ed748426e660b6dacc9a9
Into a Git object hash, so i can properly use git show and git cat-file, as well git ls-tree. My app currently looks like this:
show.php?h=76e2242459d360f7429ed748426e660b6dacc9a9
I want to convert paths into something more usable, like:
show.php?branch=master&path=repository/folder/test/myfile.py
Any ideas?
The branch:path notation was the solution. Thanks Noufal Ibrahim!