question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Submodules are hard to identify by their titles

See original GitHub issue

Description

In GitHub Desktop (both in the old version and the new beta, though I wouldn’t be able to tell in the new version due to #708), if you add the same submodule to the sidebar, but from different parent repositories, they will all be listed with the same name. It appears that GitHub Desktop tries to be smart by prefixing it with the GitHub user’s username, but this is not entirely useful in figuring out which parent repository they belong to.

Version

GitHub Desktop version: 223 & 0.5.8 OS version: macOS 10.12.4

Steps to Reproduce

  1. Add a submodule from parent repo A
  2. Add the same submodule from parent repo B

Expected behaviour: The repos are listed as such:

RepoA -> user/MySubmodule
RepoB -> user/MySubmodule

(or something similar)

Actual behaviour: The repos are listed as such:

user/MySubmodule
user/MySubmodule

(which is not very helpful)

Other great differentiators could be the current branch/commit. Ideally, it should be easy to identify which submodule you were working on despite that submodule being everywhere (as submodules are likely to be):

RepoA -> org/MySubmodule
RepoB -> user/MySubmodule (bugfix)
RepoB -> user/MySubmodule (master)
user/MySubmodule

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
dimitribouniolcommented, Jan 13, 2019

Ping @shiftkey, since as others point out, it has been a while 😊

Here is another interpretation how I imagine it can look. In this mockup, I grew the row heights to 43pt, and added another line that contains both the current branch (or truncated commit, if on HEAD), and the local path of the repo, truncated at the beginning of the path if necessary. As I experimented, I realized this information is always useful, so I have it for all rows rather than just the ambiguous paths, as I originally suggested.

The commit is especially useful when comparing to the diff a main repo would show if the submodule was in a different state than what was originally committed. The branch name would also be very useful when switching between different repos that are in different states.

Finally, I would love for this column to always be visible much like the old GitHub desktop, as it facilitated going back and forth between repos very quickly (I’m still using the old app primarily for this reason… sorry 😕). Even better would be to open multiple windows, each showing their own repo, which would provide the best experience for power users.

(I also realize after I uploaded, but the paths should include the folder of the git repo as well, and not just the name of the repo on GitHub, since they can be different. So the first entry would probably read ...inRepo/Libraries/SubMod if the .git/ itself is within the directory SubMod)

github-branched-mockup 2x

Some metrics: The row heights grow to 43pt, the icons are shifted down by 7pt, the new text is 10pt, black at 40% opacity. The selected state is white at 75% opacity. The top row of text doesn’t change or move in any way. A bullet character is used to separate the branch and the path which again, is truncated at the start, and runs along to the same extent as the top line of text. If space is limited, I would give priority to the branch rather than the path.

3reactions
rsodrecommented, Oct 22, 2017

This lack of submodule parenting also bothers me a lot, and in my mind it’s really easy to solve the UI part of it with a tree view.

Perfect solution: Any repositories that have submodules should contain a “+” or “►” on the side to unfold and reveal the submodules. They can all be greyed out, and if you check out any of them, it is linked to the github repository, like opening a local repo.

Acceptable solution: Even if it does not recognize submodules as I’m suggesting, if I open a local repository that is a submodule of any repository already opened, just parent it below it, indented.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does git fail to fetch specific valid submodule for a given ...
Running this command after cloning (and receiving the error) solved my problem: git submodule update --force --recursive --init --remote.
Read more >
Why you should (probably) not use submodules
Submodules as a decomposing tool​​ These kinds of situations are often difficult to experiment with, because everything is dependent on things ...
Read more >
Ask HN: Why are Git submodules so bad? - Hacker News
Switching branches in a repository with submodules is a huge pain, especially if (like the Ansible repo) some branches have the subdirectory in...
Read more >
Cannot fetch submodules (#1569) · Issues - GitLab
As a workaround, it's not exactly pleasant, but we are injecting SSH keys, as well as the GitLab host key via CI "private...
Read more >
Submodules | Learn Version Control with Git - Tower Git Client
It's important to understand that the actual contents of a Submodule are not stored in its parent repository. Only its remote URL, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found