Tags: gitgitgadget/git
Tags
gitk: support config the color of linkfgcolor via Gitk Preferences From: Wang Zichong <wangzichong@deepin.org> As a dark-theme user, I use the Preferences dialog to set colors for gitk, the only color I cannot change via that dialog is the link foreground color, which will lead me to use the default link color on a dark background that make it not really readable. This patch makes the link foreground color also configurable in the Gitk Preferences dialog's Color tab, so user won't need to dig into the code/manual to know if the link color is configurable and can simply set the color there. CC: Mark Levedahl <mlevedahl@gmail.com>, Paul Mackerras <paulus@samba.org> Signed-off-by: Wang Zichong <wangzichong@deepin.org> Submitted-As: https://lore.kernel.org/git/pull.2217.git.git.1772109195114.gitgitgadget@gmail.com
repo info: add category/path keys and --path-format This series now focuses only on git repo info improvements. =========================================================== It introduces category-aware key requests, adds path-oriented keys (path.*), and adds --path-format=(absolute|relative) so scripts can request stable path rendering behavior. What this PR does ================= For git repo info, this series: * introduces explicit info-context plumbing in the codepath, * adds category-key expansion (for example, layout expands to layout.*), * adds path-oriented keys (path.*) for common repository locations, * adds --path-format=(absolute|relative) to control path output style. Tests and documentation are updated accordingly. What this PR does NOT do ======================== * No git repo structure feature changes. * No t1901 structure test changes. * No structure metrics/docs additions. Why this change =============== * Makes git repo info more script-friendly by reducing the need for multiple plumbing calls. * Improves output ergonomics through category requests and explicit path formatting. * Keeps this series narrowly scoped and non-overlapping with in-flight repo structure work. Commit structure ================ * repo: teach info context and category keys * repo: add path keys to repo info * repo: add --path-format for info path output * t1900: cover repo info path keys and path-format * docs: describe repo info path keys All commits are signed off with the same real-name identity. Changes since previous revision =============================== * Dropped all repo structure code, tests, and docs from this PR. * Kept only the repo info subset and matching t1900/documentation updates. * Preserved split, review-friendly commit structure. Validation ========== Focused: * make -C t test T=t1900-repo.sh (Linux container): passed. Full: * make test in Linux Docker environment: failed 0 (with expected prereq-based broken/skipped categories). Eslam reda ragheb (10): repo: teach info context and category keys repo: add path keys to repo info repo: add --path-format for info path output repo: add structure max object size metrics repo: add structure topology and path-depth metrics repo: add aggregate structure totals to keyvalue output t1900: cover repo info path keys and path-format t1901: extend structure metric coverage and portability docs: describe repo info path keys and structure metrics repo: reduce repetition in structure keyvalue output Documentation/git-repo.adoc | 67 ++++- builtin/repo.c | 584 ++++++++++++++++++++++++++++++++---- t/t1900-repo.sh | 196 ++++++++++++ t/t1901-repo-structure.sh | 250 +++++++++++---- 4 files changed, 977 insertions(+), 120 deletions(-) base-commit: 7c02d39 Submitted-As: https://lore.kernel.org/git/pull.2208.v4.git.git.1772140487.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2208.git.git.1771784936.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2208.v2.git.git.1771856469.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2208.v3.git.git.1771875812.gitgitgadget@gmail.com
fsmonitor: implement filesystem change listener for Linux This series implements the built-in fsmonitor daemon for Linux using the inotify API, bringing it to feature parity with the existing Windows and macOS implementations. It also fixes two memory leaks in the platform-independent daemon code and deduplicates the IPC and settings logic that is now shared between macOS and Linux. The implementation uses inotify rather than fanotify because fanotify requires either CAP_SYS_ADMIN or CAP_PERFMON capabilities, making it unsuitable for an unprivileged user-space daemon. While inotify has the limitation of requiring a separate watch on every directory (unlike macOS FSEvents, which can monitor an entire directory tree with a single watch), it operates without elevated privileges and provides the per-file event granularity needed for fsmonitor. The listener uses inotify_init1(O_NONBLOCK) with a poll loop that checks for events with a 50-millisecond timeout, keeping the inotify queue well-drained to minimize the risk of overflows. Bidirectional hashmaps map between watch descriptors and directory paths for efficient event resolution. Directory renames are tracked using inotify cookie mechanism to correlate IN_MOVED_FROM and IN_MOVED_TO event pairs; a periodic check detects stale renames where the matching IN_MOVED_TO never arrived, forcing a resync. New directory creation triggers recursive watch registration to ensure all subdirectories are monitored. The IN_MASK_CREATE flag is used where available to prevent modifying existing watches, with a fallback for older kernels. When IN_MASK_CREATE is available and inotify_add_watch returns EEXIST, it means another thread or recursive scan has already registered the watch, so it is safe to ignore. Remote filesystem detection uses statfs() to identify network-mounted filesystems (NFS, CIFS, SMB, FUSE, etc.) via their magic numbers. Mount point information is read from /proc/mounts and matched against the statfs f_fsid to get accurate, human-readable filesystem type names for logging. When the .git directory is on a remote filesystem, the IPC socket falls back to $HOME or a user-configured directory via the fsmonitor.socketDir setting. This series builds on work from git#1352 by Eric DeCosta and git#1667 by Marziyeh Esipreh, updated to work with the current codebase and address all review feedback. Changes since v6: * Introduced FSMONITOR_OS_SETTINGS build variable (set to "unix" for macOS and Linux, "win32" for Windows) to eliminate if/else conditionals in Makefile, meson.build, and CMakeLists.txt per Junio's review * Moved fsm-path-utils from FSMONITOR_OS_SETTINGS to FSMONITOR_DAEMON_BACKEND since path-utils files are platform-specific * Removed V9FS_MAGIC from remote filesystem detection (9p is used for local VM/container host mounts where fsmonitor works fine) * Removed redundant #include <libgen.h> (already provided by compat/posix.h) * Fixed cookie wait comment wording ("see" → "observe") * Rewrote commit messages for IPC and settings dedup patches Changes since v5: * Split monolithic commit into 10-patch series per Patrick's review * Deduplicated fsm-ipc and fsm-settings into shared Unix implementations * Rewrote commit message with prose paragraphs, explain inotify vs fanotify, removed "Issues addressed" sections, added Based-on-patch-by trailers * Removed redundant includes already provided by compat/posix.h * Fixed error/trace message capitalization per coding guidelines * Fixed stale rename check interval from 1000 seconds to 1 second * Changed poll timeout from 1ms to 50ms to reduce idle CPU wake-ups * Replaced infinite pthread_cond_wait cookie loop with one-second pthread_cond_timedwait (prevents daemon hangs on overlay filesystems where events are never delivered) * Added pthread_cond_timedwait to Windows pthread compatibility layer * Separated test into its own commit with smoke test that skips when inotify events are not delivered (e.g., overlayfs with older kernels) * Fixed test hang on Fedora CI: stop_git() looped forever when ps was unavailable because bash in POSIX/sh mode returns exit 0 from kill with an empty process group argument. Fixed by falling back to /proc/$pid/stat for process group ID and guarding stop_git against empty pgid. * Redirect spawn_daemon() stdout/stderr to /dev/null and close inherited file descriptors to prevent the intermediate process from holding test pipe file descriptors * Call setsid() on daemon detach to prevent shells with job control from waiting on the daemon process group * Close inherited file descriptors 3-7 in the test watchdog subprocess * Added 30-second timeout to "fsmonitor--daemon stop" to prevent indefinite blocking * Added helpful error message when inotify watch limit (max_user_watches) is reached * Initialize fd_inotify to -1 and use fd >= 0 check for correct fd 0 handling * Use sysconf(_SC_OPEN_MAX) instead of hardcoded 1024 for fd close limit * Check setsid() return value Changes since v4: * Added Meson build support Changes since v3: * Fix crash on rapid nested directory creation (EEXIST from inotify_add_watch with IN_MASK_CREATE) * Extensive stress testing Changes since v2: * Fix khash memory leak in do_handle_client Changes since v1: * Fix hashmap memory leak in fsmonitor_run_daemon() Paul Tarjan (10): fsmonitor: fix khash memory leak in do_handle_client fsmonitor: fix hashmap memory leak in fsmonitor_run_daemon compat/win32: add pthread_cond_timedwait fsmonitor: use pthread_cond_timedwait for cookie wait fsmonitor: deduplicate IPC path logic for Unix platforms fsmonitor: deduplicate settings logic for Unix platforms fsmonitor: implement filesystem change listener for Linux fsmonitor: add tests for Linux run-command: add close_fd_above_stderr option fsmonitor: close inherited file descriptors and detach in daemon Documentation/config/fsmonitor--daemon.adoc | 4 +- Documentation/git-fsmonitor--daemon.adoc | 28 +- Makefile | 4 +- builtin/fsmonitor--daemon.c | 71 +- compat/fsmonitor/fsm-health-linux.c | 33 + .../{fsm-ipc-darwin.c => fsm-ipc-unix.c} | 4 +- compat/fsmonitor/fsm-listen-linux.c | 746 ++++++++++++++++++ compat/fsmonitor/fsm-path-utils-linux.c | 220 ++++++ ...-settings-darwin.c => fsm-settings-unix.c} | 24 +- compat/win32/pthread.c | 26 + compat/win32/pthread.h | 2 + config.mak.uname | 12 +- contrib/buildsystems/CMakeLists.txt | 29 +- fsmonitor-ipc.c | 3 + meson.build | 13 +- run-command.c | 11 + run-command.h | 9 + t/t7527-builtin-fsmonitor.sh | 101 ++- 18 files changed, 1278 insertions(+), 62 deletions(-) create mode 100644 compat/fsmonitor/fsm-health-linux.c rename compat/fsmonitor/{fsm-ipc-darwin.c => fsm-ipc-unix.c} (96%) create mode 100644 compat/fsmonitor/fsm-listen-linux.c create mode 100644 compat/fsmonitor/fsm-path-utils-linux.c rename compat/fsmonitor/{fsm-settings-darwin.c => fsm-settings-unix.c} (82%) base-commit: 3e0db84 Submitted-As: https://lore.kernel.org/git/pull.2147.v7.git.git.1772065643.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.git.git.1767082450088.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.v2.git.git.1767096494372.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.v3.git.git.1767099302592.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.v4.git.git.1767202894884.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.v5.git.git.1771896704209.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.v6.git.git.1772050636.gitgitgadget@gmail.com
status: add status.compareBranches config for multiple branch compari…
…sons
cc: Chris Torek chris.torek@gmail.com cc: Yee Cheng Chin
ychin.macvim@gmail.com cc: "brian m. carlson" sandals@crustytoothpaste.net
cc: Ben Knoble ben.knoble@gmail.com cc: "Kristoffer Haugsbakk"
kristofferhaugsbakk@fastmail.com cc: Phillip Wood phillip.wood123@gmail.com
cc: Nico Williams nico@cryptonector.com cc: Patrick Steinhardt ps@pks.im cc:
Jeff King peff@peff.net
Harald Nordgren (2):
refactor format_branch_comparison in preparation
status: add status.compareBranches config for multiple branch
comparisons
Documentation/config/status.adoc | 19 ++
remote.c | 178 ++++++++++++++----
t/t6040-tracking-info.sh | 310 +++++++++++++++++++++++++++++++
3 files changed, 470 insertions(+), 37 deletions(-)
base-commit: 7b2bccb
Submitted-As: https://lore.kernel.org/git/pull.2138.v30.git.git.1772102022.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.git.git.1766451217075.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v2.git.git.1766530448.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v3.git.git.1766568665.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v4.git.git.1766571587.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v5.git.git.1766572715.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v6.git.git.1766619672.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v7.git.git.1766655947789.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v8.git.git.1766666006561.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v9.git.git.1766936483.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v10.git.git.1767110888.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v11.git.git.1767352663477.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v12.git.git.1767389649.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v13.git.git.1767409701.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v14.git.git.1767445236.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v15.git.git.1767527634.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v16.git.git.1767568882.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v17.git.git.1767608269.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v18.git.git.1767976906.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v19.git.git.1767984037.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v20.git.git.1768051831.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v21.git.git.1768058653.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v22.git.git.1768074976.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v23.git.git.1768249586.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v24.git.git.1768298118.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v25.git.git.1768306316.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v26.git.git.1768766353.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v27.git.git.1769096240.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v28.git.git.1769112471.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v29.git.git.1772056263.gitgitgadget@gmail.com
t7605: use test_path_is_file instead of test -f From: Mansi <mansimaanu8627@gmail.com> Replace old-style 'test -f' path checks with the modern test_path_is_file helper in the merge_c1_to_c2_cmds block. The helper provides clearer failure messages and is the established convention in Git's test suite. Signed-off-by: Mansi <mansimaanu8627@gmail.com> Submitted-As: https://lore.kernel.org/git/pull.2050.v2.git.1772067478775.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2050.git.1771911268805.gitgitgadget@gmail.com
fetch: fix wrong evaluation order in URL trailing-slash trimming From: cuiweixie <cuiweixie@gmail.com> if i == -1, url[i] will be UB. Signed-off-by: cuiweixie <cuiweixie@gmail.com> Submitted-As: https://lore.kernel.org/git/pull.2211.git.git.1771984857879.gitgitgadget@gmail.com
gc: add git maintenance list command From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= <rleone@scaleway.com> List all repositories registered for background maintenance. This displays the paths of all repositories that are configured in the maintenance.repo config variable. By default, it reads from the global config, but you can specify a different config file with the --config-file option. Signed-off-by: Rémy Léone <rleone@scaleway.com> Submitted-As: https://lore.kernel.org/git/pull.2201.git.git.1772040758787.gitgitgadget@gmail.com
fsmonitor: implement filesystem change listener for Linux This series implements the built-in fsmonitor daemon for Linux using the inotify API, bringing it to feature parity with the existing Windows and macOS implementations. It also fixes two memory leaks in the platform-independent daemon code and deduplicates the IPC and settings logic that is now shared between macOS and Linux. The implementation uses inotify rather than fanotify because fanotify requires either CAP_SYS_ADMIN or CAP_PERFMON capabilities, making it unsuitable for an unprivileged user-space daemon. While inotify has the limitation of requiring a separate watch on every directory (unlike macOS FSEvents, which can monitor an entire directory tree with a single watch), it operates without elevated privileges and provides the per-file event granularity needed for fsmonitor. The listener uses inotify_init1(O_NONBLOCK) with a poll loop that checks for events with a 50-millisecond timeout, keeping the inotify queue well-drained to minimize the risk of overflows. Bidirectional hashmaps map between watch descriptors and directory paths for efficient event resolution. Directory renames are tracked using inotify cookie mechanism to correlate IN_MOVED_FROM and IN_MOVED_TO event pairs; a periodic check detects stale renames where the matching IN_MOVED_TO never arrived, forcing a resync. New directory creation triggers recursive watch registration to ensure all subdirectories are monitored. The IN_MASK_CREATE flag is used where available to prevent modifying existing watches, with a fallback for older kernels. When IN_MASK_CREATE is available and inotify_add_watch returns EEXIST, it means another thread or recursive scan has already registered the watch, so it is safe to ignore. Remote filesystem detection uses statfs() to identify network-mounted filesystems (NFS, CIFS, SMB, FUSE, etc.) via their magic numbers. Mount point information is read from /proc/mounts and matched against the statfs f_fsid to get accurate, human-readable filesystem type names for logging. When the .git directory is on a remote filesystem, the IPC socket falls back to $HOME or a user-configured directory via the fsmonitor.socketDir setting. This series builds on work from git#1352 by Eric DeCosta and git#1667 by Marziyeh Esipreh, updated to work with the current codebase and address all review feedback. Changes since v5: * Split monolithic commit into 10-patch series per Patrick's review * Deduplicated fsm-ipc and fsm-settings into shared Unix implementations * Rewrote commit message with prose paragraphs, explain inotify vs fanotify, removed "Issues addressed" sections, added Based-on-patch-by trailers * Removed redundant includes already provided by compat/posix.h * Fixed error/trace message capitalization per coding guidelines * Fixed stale rename check interval from 1000 seconds to 1 second * Changed poll timeout from 1ms to 50ms to reduce idle CPU wake-ups * Replaced infinite pthread_cond_wait cookie loop with one-second pthread_cond_timedwait (prevents daemon hangs on overlay filesystems where events are never delivered) * Added pthread_cond_timedwait to Windows pthread compatibility layer * Separated test into its own commit with smoke test that skips when inotify events are not delivered (e.g., overlayfs with older kernels) * Fixed test hang on Fedora CI: stop_git() looped forever when ps was unavailable because bash in POSIX/sh mode returns exit 0 from kill with an empty process group argument. Fixed by falling back to /proc/$pid/stat for process group ID and guarding stop_git against empty pgid. * Redirect spawn_daemon() stdout/stderr to /dev/null and close inherited file descriptors to prevent the intermediate process from holding test pipe file descriptors * Call setsid() on daemon detach to prevent shells with job control from waiting on the daemon process group * Close inherited file descriptors 3-7 in the test watchdog subprocess * Added 30-second timeout to "fsmonitor--daemon stop" to prevent indefinite blocking * Added helpful error message when inotify watch limit (max_user_watches) is reached * Initialize fd_inotify to -1 and use fd >= 0 check for correct fd 0 handling * Use sysconf(_SC_OPEN_MAX) instead of hardcoded 1024 for fd close limit * Check setsid() return value Changes since v4: * Added Meson build support Changes since v3: * Fix crash on rapid nested directory creation (EEXIST from inotify_add_watch with IN_MASK_CREATE) * Extensive stress testing Changes since v2: * Fix khash memory leak in do_handle_client Changes since v1: * Fix hashmap memory leak in fsmonitor_run_daemon() Paul Tarjan (10): fsmonitor: fix khash memory leak in do_handle_client fsmonitor: fix hashmap memory leak in fsmonitor_run_daemon compat/win32: add pthread_cond_timedwait fsmonitor: use pthread_cond_timedwait for cookie wait fsmonitor: deduplicate IPC path logic for Unix platforms fsmonitor: deduplicate settings logic for Unix platforms fsmonitor: implement filesystem change listener for Linux fsmonitor: add tests for Linux run-command: add close_fd_above_stderr option fsmonitor: close inherited file descriptors and detach in daemon Documentation/config/fsmonitor--daemon.adoc | 4 +- Documentation/git-fsmonitor--daemon.adoc | 28 +- Makefile | 12 +- builtin/fsmonitor--daemon.c | 71 +- compat/fsmonitor/fsm-health-linux.c | 33 + .../{fsm-ipc-darwin.c => fsm-ipc-unix.c} | 4 +- compat/fsmonitor/fsm-listen-linux.c | 746 ++++++++++++++++++ compat/fsmonitor/fsm-path-utils-linux.c | 220 ++++++ ...-settings-darwin.c => fsm-settings-unix.c} | 24 +- compat/win32/pthread.c | 26 + compat/win32/pthread.h | 2 + config.mak.uname | 10 + contrib/buildsystems/CMakeLists.txt | 14 +- fsmonitor-ipc.c | 3 + meson.build | 17 +- run-command.c | 11 + run-command.h | 9 + t/t7527-builtin-fsmonitor.sh | 101 ++- 18 files changed, 1286 insertions(+), 49 deletions(-) create mode 100644 compat/fsmonitor/fsm-health-linux.c rename compat/fsmonitor/{fsm-ipc-darwin.c => fsm-ipc-unix.c} (96%) create mode 100644 compat/fsmonitor/fsm-listen-linux.c create mode 100644 compat/fsmonitor/fsm-path-utils-linux.c rename compat/fsmonitor/{fsm-settings-darwin.c => fsm-settings-unix.c} (82%) base-commit: 3e0db84 Submitted-As: https://lore.kernel.org/git/pull.2147.v6.git.git.1772050636.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.git.git.1767082450088.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.v2.git.git.1767096494372.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.v3.git.git.1767099302592.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.v4.git.git.1767202894884.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.v5.git.git.1771896704209.gitgitgadget@gmail.com
status: add status.compareBranches config for multiple branch compari…
…sons
cc: Chris Torek chris.torek@gmail.com cc: Yee Cheng Chin
ychin.macvim@gmail.com cc: "brian m. carlson" sandals@crustytoothpaste.net
cc: Ben Knoble ben.knoble@gmail.com cc: "Kristoffer Haugsbakk"
kristofferhaugsbakk@fastmail.com cc: Phillip Wood phillip.wood123@gmail.com
cc: Nico Williams nico@cryptonector.com cc: Patrick Steinhardt ps@pks.im cc:
Jeff King peff@peff.net
Harald Nordgren (2):
refactor format_branch_comparison in preparation
status: add status.compareBranches config for multiple branch
comparisons
Documentation/config/status.adoc | 19 ++
remote.c | 180 +++++++++++++----
t/t6040-tracking-info.sh | 335 +++++++++++++++++++++++++++++++
3 files changed, 497 insertions(+), 37 deletions(-)
base-commit: 7c02d39
Submitted-As: https://lore.kernel.org/git/pull.2138.v29.git.git.1772056263.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.git.git.1766451217075.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v2.git.git.1766530448.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v3.git.git.1766568665.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v4.git.git.1766571587.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v5.git.git.1766572715.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v6.git.git.1766619672.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v7.git.git.1766655947789.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v8.git.git.1766666006561.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v9.git.git.1766936483.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v10.git.git.1767110888.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v11.git.git.1767352663477.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v12.git.git.1767389649.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v13.git.git.1767409701.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v14.git.git.1767445236.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v15.git.git.1767527634.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v16.git.git.1767568882.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v17.git.git.1767608269.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v18.git.git.1767976906.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v19.git.git.1767984037.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v20.git.git.1768051831.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v21.git.git.1768058653.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v22.git.git.1768074976.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v23.git.git.1768249586.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v24.git.git.1768298118.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v25.git.git.1768306316.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v26.git.git.1768766353.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v27.git.git.1769096240.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2138.v28.git.git.1769112471.gitgitgadget@gmail.com
fsmonitor: implement filesystem change listener for Linux From: Paul Tarjan <github@paulisageek.com> Implement fsmonitor for Linux using the inotify API, bringing it to feature parity with existing Windows and macOS implementations. The Linux implementation uses inotify to monitor filesystem events. Unlike macOS's FSEvents which can watch a single root directory, inotify requires registering watches on every directory of interest. The implementation carefully handles directory renames and moves using inotify's cookie mechanism to track IN_MOVED_FROM/IN_MOVED_TO event pairs. Key implementation details: - Uses inotify_init1(O_NONBLOCK) for non-blocking event monitoring - Maintains bidirectional hashmaps between watch descriptors and paths for efficient event processing - Handles directory creation, deletion, and renames dynamically - Detects remote filesystems (NFS, CIFS, SMB, etc.) via statfs() - Falls back to $HOME/.git-fsmonitor-* for socket when .git is remote Build configuration: - Enabled via FSMONITOR_DAEMON_BACKEND=linux and FSMONITOR_OS_SETTINGS=linux - Requires NO_PTHREADS and NO_UNIX_SOCKETS to be unset - Adds HAVE_LINUX_MAGIC_H for filesystem type detection Documentation updated to note that fsmonitor.socketDir is now supported on both Mac OS and Linux, and adds a section about inotify watch limits. Issues addressed from PR #1352 (git/git) review comments: - GPLv3 ME_REMOTE macro: Rewrote remote filesystem detection from scratch using statfs() and linux/magic.h constants (no GPLv3 code) - Memory leak on inotify_init1 failure: Added FREE_AND_NULL cleanup - Unsafe hashmap iteration in dtor: Collect entries first, then modify - Missing null checks in stop_async: Added proper guard conditions - dirname() modifying argument: Create copy with xstrdup() first - Non-portable f_fsid.__val: Use memcmp() for fsid comparison - Missing worktree null check: Added BUG() for null worktree - Header updates: Use git-compat-util.h, hash_to_hex_algop() - Code style: Use xstrdup() not xmemdupz(), proper pointer style Issues addressed from PR #1667 (git/git) review comments: - EINTR handling: read() now handles both EAGAIN and EINTR - Trailing pipe in log_mask_set: Added strbuf_strip_suffix() - Unchecked add_watch return: Now logs failure in rename_dir() - String building: Consolidated strbuf operations with strbuf_addf() - Translation markers: Added _() to all error_errno() messages Based on work from git#1352 by Eric DeCosta, and git#1667 by Marziyeh Esipreh, updated to work with the current codebase and address all review feedback. Signed-off-by: Paul Tarjan <github@paulisageek.com> Submitted-As: https://lore.kernel.org/git/pull.2147.v5.git.git.1771896704209.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.git.git.1767082450088.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.v2.git.git.1767096494372.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.v3.git.git.1767099302592.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.2147.v4.git.git.1767202894884.gitgitgadget@gmail.com
PreviousNext