You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in this case, if I'm in worktree 2, the lazygit Status pane will read: main(2) → jwhitley/some-branch which isn't particularly informative. Or worse, if the main worktree was just 1 as I've sometimes done then it would read 1(2) -> .... 🙄
Obviously, lazygit's current convention is based on a "parallel" layout, ala /path/to/lazygit/, /path/to/lazygit2/, etc. rather than a subdirectory layout like I'm using above. I don't tend to use that because I find it annoying with shell autocompletion, and it eventually adds noise when one has a lot of repositories and worktrees hanging around. The root problem is that the git worktree feature implies nothing about naming conventions or file-system organization of worktrees.
Point of discussion:
Does there even exist a way to be "smarter" about this? I currently think the only way to canonically get the right labelling here is to "ask" the user (via config) what their preferred worktree layout is. For example:
worktreeLabel: main-worktree – the current default behavior, where the main worktree's directory name is used
worktreeLabel: parent-dir - the parent directory of the worktree, whether main or linked, is used
Other cases could be added if/when needed.
An alternative approach would be to make worktreeLabel specify a path to the directory to use as a name, using a sort of templating ala:
worktreeLabel: {{mainWorktree}} – the current default
worktreeLabel: {{mainWorktree}}/.. – parent of the main worktree
worktreeLabel: {{currentWorktree}}/.. – parent of the current worktree
Any config-based approach would also dovetail nicely with @stefanhaller's proposal in #3293, in the event that a given user needed mixed conventions across their various repos for some reason.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Topic: lazygit naming for the worktree "parent" in the UI is ... hard. An example, using a worktree layout I frequently use:
in this case, if I'm in worktree
2
, the lazygit Status pane will read:main(2) → jwhitley/some-branch
which isn't particularly informative. Or worse, if the main worktree was just1
as I've sometimes done then it would read1(2) -> ...
. 🙄Obviously, lazygit's current convention is based on a "parallel" layout, ala
/path/to/lazygit/
,/path/to/lazygit2/
, etc. rather than a subdirectory layout like I'm using above. I don't tend to use that because I find it annoying with shell autocompletion, and it eventually adds noise when one has a lot of repositories and worktrees hanging around. The root problem is that the git worktree feature implies nothing about naming conventions or file-system organization of worktrees.Point of discussion:
Does there even exist a way to be "smarter" about this? I currently think the only way to canonically get the right labelling here is to "ask" the user (via config) what their preferred worktree layout is. For example:
worktreeLabel: main-worktree
– the current default behavior, where the main worktree's directory name is usedworktreeLabel: parent-dir
- the parent directory of the worktree, whether main or linked, is usedOther cases could be added if/when needed.
An alternative approach would be to make
worktreeLabel
specify a path to the directory to use as a name, using a sort of templating ala:worktreeLabel: {{mainWorktree}}
– the current defaultworktreeLabel: {{mainWorktree}}/..
– parent of the main worktreeworktreeLabel: {{currentWorktree}}/..
– parent of the current worktreeAny config-based approach would also dovetail nicely with @stefanhaller's proposal in #3293, in the event that a given user needed mixed conventions across their various repos for some reason.
Beta Was this translation helpful? Give feedback.
All reactions