On Thu, Sep 01, 2016 at 03:16:38PM -0700, Junio C Hamano wrote:
> Which means that piggybacking this on the "run 'git diff' limited to
> the pathspec to find the paths that needs updating" logic usually
> done in "git add" can not be reused [*1*].
> What was I thinking while reviewing the patch X-<. Sigh.
> *1* I guess we _could_, by first flipping all the regular file
> blob's executable bit for paths that are inside the pathspec and
> then by running "git diff" against that modified index, limited
> to the pathspec, to find the paths that need to be added.
> It sounds ugly, but may conceptually be cleaner. We first start
> from an ideal end-result, and then re-hash what needs to be
> updated to match the ideal.
Yeah, I had a similar thought, but it just feels so hacky. Is there
anything wrong with making this completely separate from the content
update. I.e., just applying the pathspec to the index as a separate step
and adding "+x" to each entry?
This really is just a more convenient interface around "update-index
--chmod", isn't it? We should be able to do the same thing it does.