Git-subrepo: git log subrepo/<subdir>/fetch not working

Created on 22 Jun 2019  路  3Comments  路  Source: ingydotnet/git-subrepo

How to see the subrepo history?

Question

Most helpful comment

The reason you would get the error for the log command is that the metadata for the subrepo has not been fetched. This can be caused by performing a git subrepo clean, or just checking out a repo and not using the subrepo commands. It is suggested that you use git subrepo fetch before attempting to use the git log on a subrepo.

All 3 comments

Thank you for a great git feature. subrepo clone has worked very well for my use cases. I have not figured out whether one should be able to see the commit log history of the subrepo though.

In git subrepo help, it says "git log subrepo/\/fetch" will show the subrepo history. But that doesn't work for me.

$ git log subrepo/themes/bilberry-hugo-theme/fetch
fatal: ambiguous argument 'subrepo/themes/bilberry-hugo-theme/fetch': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

The error is the same for any nonsensical path passed to git log.

The README gives two forms of git log incantation. The same as above, and then also
git log refs/subrepo/<subdir>/fetch

which fails for me with the same error. I'm running git version 1.20.1 on a mac and the subrepo version from Nov 2018, pulled yesterday from master, version 0.4.0.

After squashing, is the history still from the subrepo still available locally? Have I misunderstood something about the command usage or is there a new way to see the commit history?

Thanks again for a very nice tool. I know if I really want to see the commit history, I can always download the repo to a temporary location.

@FrankReh you can run git subrepo branch <subrepo>, then you will generate a branch (and a worktree with that branch) and that should allow you to check the logs for the subrepo.

The reason you would get the error for the log command is that the metadata for the subrepo has not been fetched. This can be caused by performing a git subrepo clean, or just checking out a repo and not using the subrepo commands. It is suggested that you use git subrepo fetch before attempting to use the git log on a subrepo.

Was this page helpful?
0 / 5 - 0 ratings