From: "Alexey Samsonov via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Alexey Samsonov <vonosmas@gmail.com>,
Alexey Samsonov <vonosmas@gmail.com>
Subject: [PATCH 3/3] compat/posix: drop legacy <utime.h> header and shims
Date: Fri, 21 Aug 2026 14:23:23 +0000 [thread overview]
Message-ID: <9c737bd600bac6b6645a10f6b36951985a99262d.1787322203.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.2209.git.1787322203.gitgitgadget@gmail.com>
From: Alexey Samsonov <vonosmas@gmail.com>
With all callers across the codebase now converted to utimensat(2), we no
longer need to include the legacy <utime.h> header in `compat/posix.h`.
Remove `#include <utime.h>` from `compat/posix.h` and test fixtures,
remove `mingw_utime()` from `compat/mingw.c`, and delete the legacy
header shims in `compat/vcbuild/include/`.
Signed-off-by: Alexey Samsonov <vonosmas@gmail.com>
---
compat/mingw-posix.h | 2 --
compat/mingw.c | 16 --------------
compat/posix.h | 1 -
compat/vcbuild/include/sys/utime.h | 34 ------------------------------
compat/vcbuild/include/utime.h | 1 -
t/helper/test-chmtime.c | 1 -
t/t4051/includes.c | 1 -
7 files changed, 56 deletions(-)
delete mode 100644 compat/vcbuild/include/sys/utime.h
delete mode 100644 compat/vcbuild/include/utime.h
diff --git a/compat/mingw-posix.h b/compat/mingw-posix.h
index aab91d76db..286ca24002 100644
--- a/compat/mingw-posix.h
+++ b/compat/mingw-posix.h
@@ -384,8 +384,6 @@ int mingw_fstat(int fd, struct stat *buf);
#define lstat mingw_lstat
-int mingw_utime(const char *file_name, const struct utimbuf *times);
-#define utime mingw_utime
int mingw_utimensat(int fd, const char *path, const struct timespec times[2], int flag);
#define utimensat mingw_utimensat
size_t mingw_strftime(char *s, size_t max,
diff --git a/compat/mingw.c b/compat/mingw.c
index d09a976191..e2ec44fdd2 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1480,22 +1480,6 @@ revert_attrs:
return rc;
}
-int mingw_utime(const char *file_name, const struct utimbuf *times)
-{
- struct timespec ts[2];
- struct timespec *tsp = NULL;
-
- if (times) {
- ts[0].tv_sec = times->actime;
- ts[0].tv_nsec = 0;
- ts[1].tv_sec = times->modtime;
- ts[1].tv_nsec = 0;
- tsp = ts;
- }
-
- return mingw_utimensat(AT_FDCWD, file_name, tsp, 0);
-}
-
#undef strftime
size_t mingw_strftime(char *s, size_t max,
const char *format, const struct tm *tm)
diff --git a/compat/posix.h b/compat/posix.h
index 3cac1751aa..435ed90f56 100644
--- a/compat/posix.h
+++ b/compat/posix.h
@@ -123,7 +123,6 @@
#include <signal.h>
#include <assert.h>
#include <regex.h>
-#include <utime.h>
#include <syslog.h>
#if !defined(NO_POLL_H)
#include <poll.h>
diff --git a/compat/vcbuild/include/sys/utime.h b/compat/vcbuild/include/sys/utime.h
deleted file mode 100644
index 582589c70a..0000000000
--- a/compat/vcbuild/include/sys/utime.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef _UTIME_H_
-#define _UTIME_H_
-/*
- * UTIME.H
- * This file has no copyright assigned and is placed in the Public Domain.
- * This file is a part of the mingw-runtime package.
- *
- * The mingw-runtime package and its code is distributed in the hope that it
- * will be useful but WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESSED OR
- * IMPLIED ARE HEREBY DISCLAIMED. This includes but is not limited to
- * warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You are free to use this package and its code without limitation.
- */
-
-/*
- * Structure used by _utime function.
- */
-struct _utimbuf
-{
- time_t actime; /* Access time */
- time_t modtime; /* Modification time */
-};
-
-#ifndef _NO_OLDNAMES
-/* NOTE: Must be the same as _utimbuf above. */
-struct utimbuf
-{
- time_t actime;
- time_t modtime;
-};
-#endif /* Not _NO_OLDNAMES */
-
-#endif
diff --git a/compat/vcbuild/include/utime.h b/compat/vcbuild/include/utime.h
deleted file mode 100644
index 8285f38fde..0000000000
--- a/compat/vcbuild/include/utime.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <sys/utime.h>
diff --git a/t/helper/test-chmtime.c b/t/helper/test-chmtime.c
index a9e6eb78b8..295f55cf47 100644
--- a/t/helper/test-chmtime.c
+++ b/t/helper/test-chmtime.c
@@ -38,7 +38,6 @@
*/
#include "test-tool.h"
#include "git-compat-util.h"
-#include <utime.h>
static const char usage_str[] =
"(-v|--verbose|-g|--get) (+|=|=+|=-|-)<seconds> <file>...";
diff --git a/t/t4051/includes.c b/t/t4051/includes.c
index efc68f8bf6..4861f6657b 100644
--- a/t/t4051/includes.c
+++ b/t/t4051/includes.c
@@ -15,6 +15,5 @@
#include <signal.h>
#include <assert.h>
#include <regex.h>
-#include <utime.h>
#include <syslog.h>
#include <End.h>
--
gitgitgadget
next prev parent reply other threads:[~2026-08-21 14:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 14:23 [PATCH 0/3] treewide: migrate from legacy utime.h to utimensat Alexey Samsonov via GitGitGadget
2026-08-21 14:23 ` [PATCH 1/3] compat/posix: introduce utimensat(2) wrapper Alexey Samsonov via GitGitGadget
2026-08-21 14:23 ` [PATCH 2/3] treewide: use utimensat(2) instead of legacy utime(3p) Alexey Samsonov via GitGitGadget
2026-08-21 14:23 ` Alexey Samsonov via GitGitGadget [this message]
2026-08-21 17:33 ` [PATCH 0/3] treewide: migrate from legacy utime.h to utimensat Junio C Hamano
2026-08-22 16:03 ` brian m. carlson
2026-08-22 17:59 ` Junio C Hamano
2026-08-22 21:15 ` brian m. carlson
2026-08-23 15:23 ` Junio C Hamano
2026-08-23 13:26 ` Weijie Yuan
2026-08-23 15:26 ` Junio C Hamano
2026-08-23 15:45 ` Weijie Yuan
2026-08-24 1:49 ` Junio C Hamano
2026-08-24 12:19 ` Weijie Yuan
2026-08-24 15:33 ` Weijie Yuan
2026-08-24 16:06 ` Junio C Hamano
2026-08-24 16:23 ` Junio C Hamano
2026-08-24 16:33 ` Weijie Yuan
2026-08-24 20:25 ` Oswald Buddenhagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9c737bd600bac6b6645a10f6b36951985a99262d.1787322203.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=vonosmas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox