Page MenuHomePhabricator

Accessing a submodule path directly in Diffusion has less than optimal UX
Open, WishlistPublic

Description

See PHI254. See T9915 for an earlier report.

When "poems" is a submodule, it:

  • does not respond to git cat-file -t <commit>:poems/; and
  • does not respond, in a different way, to git cat-file -t <commit>:poems.

These commands are executed via diffusion.browsequery, and can be hit in the UI by adding a submodule path (with no slash) to Owners and clicking the link, or in other ways.

Here's what happens:

epriestley@orbital ~/dev/scratch/git-test-local $ git ls-tree HEAD
100644 blob 4b03ca691fb0787bc47ad2e7839fe66977be685f	.gitmodules
160000 commit da741f11202f505ead4514591d837b729bb8ce63	poems
epriestley@orbital ~/dev/scratch/git-test-local $ git cat-file -t HEAD:poems/
fatal: Not a valid object name HEAD:poems/
epriestley@orbital ~/dev/scratch/git-test-local $ git cat-file -t HEAD:poems
fatal: git cat-file: could not get object info

There's some code to detect and recover from "Not a valid object" already, although it may not account for submodules correctly. A possible approach is to use git ls-tree -d <commit> -- <path> to recover (note that command is also case sensitive). There doesn't seem to be much help from git submodule.

Event Timeline

epriestley triaged this task as Normal priority.Dec 12 2017, 8:54 PM
epriestley created this task.
epriestley lowered the priority of this task from Normal to Wishlist.Dec 13 2017, 3:09 PM

D18831 should upgrade this from "horrible fatal" to "reasonable-but-not-ideal normal page". This could still be improved (providing the user more information and taking them into the submodule redirect workflow) but it's normally difficult to end up here without trying.

epriestley renamed this task from `git cat-file -t <commit>:<submodule>` fails to Accessing a submodule path directly in Diffusion has less than optimal UX.Dec 13 2017, 3:10 PM