0

I need a list of files (specifically regular files, not symlinks, directories, submodules, etc.) changed in a git commit. I am aware (as in e.g. this answer)that git diff-tree --name-status gives quite useful output showing a list of changed objects and what kind of change happened. This includes giving a T flag if the type changed, but I don't see any way to filter it to just objects of a specific type.

What plumbing command can I use to get a list of just files whose type (presumably after the commit is applied, not before) are of type regular file?

Caleb
  • 5,084
  • 1
  • 46
  • 65
  • 1
    You'll have to do your own checking. The diff will list the file, and its mode, in the default format, and the mode is one of `100755` (file with execute permission), `100644` (file without execute permission), `120000` (symbolic link), or `160000` (gitlink). If you don't enable recursion you can also see `040000` (tree). – torek Mar 01 '19 at 07:19
  • By the way, if you look in some very old Git repositories, you'll occasionally find a `mode 100664`: Git used to store group-write permissions. Modern Git won't create such an entity but these repositories (from the early 2000s) still have them. I vaguely recall finding one somewhere, maybe in an old Linux repo, but I know for sure that `git fsck` deliberately allows them to avoid invalidating such repos. – torek Mar 01 '19 at 16:33

0 Answers0