summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-05-11 10:05:53 +0900
committerJunio C Hamano <gitster@pobox.com>2026-05-11 10:05:54 +0900
commit570e1e0d0ff65d5a34d7d5fe005dd9650ca596fc (patch)
treedea5d06e843b311be22b31f1863eff143f00ee48
parent718db095c27b79e4bcb2d4b10f423e782b9af1dc (diff)
parentb96490241e342fe1aecbd3c4f40de6998d2a3eaa (diff)
downloadgit-570e1e0d0ff65d5a34d7d5fe005dd9650ca596fc.tar.gz
git-570e1e0d0ff65d5a34d7d5fe005dd9650ca596fc.zip
Merge branch 'jc/doc-timestamps-in-stat'
Doc update. * jc/doc-timestamps-in-stat: CodingGuidelines: st_mtimespec vs st_mtim vs st_mtime
-rw-r--r--Documentation/CodingGuidelines6
1 files changed, 6 insertions, 0 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 2aafcec40d..c06f5d3071 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -693,6 +693,12 @@ For C programs:
char *dogs[] = ...;
walk_all_dogs(dogs);
+ - For file timestamps, do not use "st_mtim" (and other timestamp
+ members in "struct stat") unconditionally; not everybody is POSIX
+ (grep for USE_ST_TIMESPEC). If you only need a timestamp in whole
+ second resolution, "st_mtime" should work fine everywhere.
+
+
For Perl programs:
- Most of the C guidelines above apply.