git-branch icon indicating copy to clipboard operation
git-branch copied to clipboard

doesn't support git worktree

Open banyudu opened this issue 6 years ago • 13 comments

In a git worktree, there's no .git/HEAD file, so gitHeadPath will return an error path.

Consider using find-git-root instead of findup-sync

banyudu avatar Mar 21 '20 01:03 banyudu

I changed the code to use find-git-root, but unfortunately that's not the only change needed, as there is no .git/HEAD either inside the worktree reference, the HEAD is directly inside the git root. @jonschlinkert if I open a PR can we get this fixed?

joscha avatar Feb 18 '21 23:02 joscha

Yes absolutely! A PR would be great.

Sent from my iPhone

On Feb 18, 2021, at 6:18 PM, Joscha Feth [email protected] wrote:

 I changed the code to use find-git-root, but unfortunately that's not the only change needed, as there is no .git/HEAD either inside the worktree reference, the HEAD is directly inside the git root. @jonschlinkert if I open a PR can we get this fixed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

jonschlinkert avatar Feb 18 '21 23:02 jonschlinkert

here you go: https://github.com/jonschlinkert/git-branch/pull/14

joscha avatar Feb 19 '21 00:02 joscha

Any chance to get this in?

On Fri, 19 Feb 2021, 10:53 Jon Schlinkert, [email protected] wrote:

Yes absolutely! A PR would be great.

Sent from my iPhone

On Feb 18, 2021, at 6:18 PM, Joscha Feth [email protected] wrote:

 I changed the code to use find-git-root, but unfortunately that's not the only change needed, as there is no .git/HEAD either inside the worktree reference, the HEAD is directly inside the git root. @jonschlinkert if I open a PR can we get this fixed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jonschlinkert/git-branch/issues/10#issuecomment-781712076, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABN5BTRENW3NHVVHXZ6D3LS7WSADANCNFSM4LQXYJXQ .

joscha avatar Feb 20 '21 19:02 joscha

@jonschlinkert please let me know if there is anything else I can do to get this in. The PR is fairly minimally invasive adds a test and will allow us to close a few other issues. Would be great to get it merged. If you do not want to merge it, that is okay as well, but please let me know as then I might fork this project and publish it independently.

joscha avatar Feb 23 '21 22:02 joscha

one last attempt - ping @jonschlinkert ?

joscha avatar Mar 09 '21 10:03 joscha

If this is about the work of the npm publish itself I am happy to do it of you add me to the package.

joscha avatar Mar 12 '21 01:03 joscha

That would be great to get it in, @jonschlinkert

olebedev avatar Apr 01 '21 04:04 olebedev

Nice fix @joscha hope it gets merged soon.

joshua-leyshon-canva avatar Apr 01 '21 04:04 joshua-leyshon-canva

+1

banyudu avatar Apr 02 '21 02:04 banyudu

Any updates on this? It would be great to get this merged in!

brotherkaif avatar May 05 '21 13:05 brotherkaif

It's probably a worthwhile idea to publish a fork if this package is abandoned.

slikts avatar Oct 26 '21 13:10 slikts

I published the fixes for this via https://www.npmjs.com/package/@fork-of/git-branch

joscha avatar Nov 11 '21 04:11 joscha