Skip to content

hasChanged function using Git log  #80

Open
@CraigChamberlain

Description

@CraigChamberlain

I guess this is a feature request but I'll try and implement myself. Want to document use case and my progress, see if anyone else has ideas, suggestions or is interested.

If I store binary files, such as images in Git LFS. When I checkout the files they all get a modified/created date of the time the files are checked out.

Two solutions:

  1. Update the timestamp.
git ls-tree -r --name-only HEAD | while read filename; do 
  unixtime=$(git log -1 --format="%at" -- "${filename}")
  touchtime=$(date -d @$unixtime +'%Y%m%d%H%M.%S')
  touch -t ${touchtime} "${filename}"
done
  1. Use gulp-git in git-changed.

I think the second option might be worth perusing and profiling for relative performance? There is potential for half the read I/O none of the write I/O.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions