Skip to content

Conversation

@wpwoodjr
Copy link
Contributor

@wpwoodjr wpwoodjr commented May 1, 2022

The PR adds a new flag, -n or --newer, to git-utimes. This flag preserves the original modification date of files that originally were committed from the local repo, where the file may have been modified well before the commit date. The --newer flag causes git-utimes to only touch files with a date that is newer than their commit date.

Additionally, this PR addresses a few issues:

  1. git-utimes would change the date of files in the working tree and index to their commit date. This version doesn't touch files in the working tree and index, on the assumption that they are being worked on and the commit date is not relevant.
  2. git-utimes would attempt to change the modification date on symbolic links. This was incorrectly changing the date on the linked file, not the symbolic link. This version correctly updates the link itself.
  3. git-utimes was using the processor count to determine how many files xargs would process on each command line (-n argument to xargs), which didn't seem to make much sense. This version passes 24 files on each xargs command line.
  4. git-utimes was always touching files even if the modification date was the same as the commit date. After a pull, even files that were not modified by the pull would be touched. This version only touches files whose modification date is not the same as the commit date. This reports only updated files and makes it easier to understand which files have been changed by a pull.

@wpwoodjr wpwoodjr changed the title git-utimes: add --newer flag and ignore files in the working tree or index git-utimes: add --newer flag and don't touch files in the working tree and index May 2, 2022
@wpwoodjr
Copy link
Contributor Author

wpwoodjr commented May 5, 2022

@spacewander I have updated per your suggestions. I also added a hint where to find the column dependency :)

@spacewander spacewander merged commit 12b2741 into tj:master May 9, 2022
@jkidd11 jkidd11 linked an issue May 24, 2022 that may be closed by this pull request
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tg

2 participants