Daniel Shahaf wrote on Wed, Mar 09, 2016 at 13:24:44 +0000: > Jun T. wrote on Mon, Mar 07, 2016 at 12:16:54 +0900: > > In the case of > > > > % git reset commit # commit is not HEAD > > > > I have no idea what to do, so I just added __git_ignore_line > > to the original code. > > I think you're looking for «git diff-index --cached -z --name-only > $treeish». Turns out there was already a helper function that did almost exactly that, so we can just reuse it. Patch attached. I took the liberty of changing the tag and description you used, since "staged files" isn't exactly right for this syntax: files that are in $treeish but not staged may also be completed. WDYT? Thanks, Daniel