Skip to content

Rebase to v2.49.0-rc1 #5465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 384 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
384 commits
Select commit Hold shift + click to select a range
0dbfe97
hash-object: add another >4GB/LLP64 test case
PhilipOakley Dec 6, 2021
5148deb
setup: properly use "%(prefix)/" when in WSL
derrickstolee Apr 13, 2022
6ace4b2
hash-object: add a >4GB/LLP64 test case using filtered input
PhilipOakley Dec 7, 2021
a304ece
compat/mingw.c: do not warn when failing to get owner
derrickstolee Apr 13, 2022
4badee2
mingw: $env:TERM="xterm-256color" for newer OSes
rkitover Apr 12, 2022
dbba545
winansi: check result and Buffer before using Name
1480c1 May 28, 2022
0747f96
Add config option `windows.appendAtomically`
sunzhuoshi Jan 15, 2022
71d9555
config.mak.uname: add support for clangarm64
dennisameling Oct 4, 2022
8e1a1fb
msvc: do handle builds on Windows/ARM64
dscho Feb 25, 2025
faeb20c
mingw: change core.fsyncObjectFiles = 1 by default
dscho Sep 4, 2017
313399b
MinGW: link as terminal server aware
rimrul Jul 10, 2022
111d874
Fix Windows version resources
Mortein Nov 2, 2022
127aa45
bswap.h: add support for built-in bswap functions
dennisameling Oct 4, 2022
c660bac
mingw(arm64): do move the `/etc/git*` location
dscho Feb 25, 2025
326758e
status: fix for old-style submodules with commondir
sceptical-coder Oct 28, 2022
91bbe70
windows: skip linking `git-<command>` for built-ins
dscho Jan 27, 2023
876622f
http: optionally load libcurl lazily
dscho May 6, 2023
9ea53f5
http: support lazy-loading libcurl also on Windows
dscho May 7, 2023
264b7b2
http: when loading libcurl lazily, allow for multiple SSL backends
dscho May 7, 2023
9113cec
windows: fix Repository>Explore Working Copy
dscho Mar 21, 2023
c3acc99
mingw: do load libcurl dynamically by default
dscho May 7, 2023
aa518b5
Add a GitHub workflow to verify that Git/Scalar work in Nano Server
dscho Nov 2, 2022
50ae28a
mingw: suggest `windows.appendAtomically` in more cases
dsl101 Jul 28, 2023
27ea77c
win32: use native ANSI sequence processing, if possible
dscho Nov 22, 2023
150c806
git.rc: include winuser.h
rimrul Dec 2, 2023
7834c25
common-main.c: fflush stdout buffer upon exit
chengzhuo5 Apr 8, 2024
b57f8db
t5601/t7406(mingw): do run tests with symlink support
dscho Apr 9, 2024
ee1bf47
win32: ensure that `localtime_r()` is declared even in i686 builds
dscho May 21, 2024
d2b15b9
revision: create mark_trees_uninteresting_dense()
derrickstolee Sep 6, 2024
605cca1
pack-objects: extract should_attempt_deltas()
derrickstolee Sep 24, 2024
a64e6e1
pack-objects: add --path-walk option
derrickstolee Sep 5, 2024
8b8417c
pack-objects: introduce GIT_TEST_PACK_PATH_WALK
derrickstolee Sep 6, 2024
131ce18
repack: add --path-walk option
derrickstolee Sep 5, 2024
a49e754
pack-objects: enable --path-walk via config
derrickstolee Sep 5, 2024
4db1577
scalar: enable path-walk during push via config
derrickstolee Sep 5, 2024
ae7e257
pack-objects: refactor path-walk delta phase
derrickstolee Sep 18, 2024
57659df
Fallback to AppData if XDG_CONFIG_HOME is unset
ariellourenco Jul 2, 2024
9fbcf05
run-command: be helpful with Git LFS fails on Windows 7
dscho Jul 4, 2024
0fd8556
pack-objects: thread the path-based compression
derrickstolee Sep 18, 2024
991d463
ci: work around a problem with HTTP/2 vs libcurl v8.10.0
dscho Sep 24, 2024
3111616
survey: stub in new experimental 'git-survey' command
Apr 29, 2024
0b82b3a
survey: add command line opts to select references
Apr 29, 2024
f43762e
survey: start pretty printing data in table form
derrickstolee Sep 1, 2024
e738760
survey: add object count summary
derrickstolee Sep 2, 2024
3f337c9
survey: summarize total sizes by object type
derrickstolee Sep 2, 2024
43a7dd2
survey: show progress during object walk
derrickstolee Sep 2, 2024
bf0b3ab
survey: add ability to track prioritized lists
derrickstolee Sep 2, 2024
74f69ea
survey: add report of "largest" paths
derrickstolee Sep 2, 2024
b3f23b3
survey: add --top=<N> option and config
derrickstolee Sep 23, 2024
5abd313
mingw: make sure `errno` is set correctly when socket operations fail
dscho Nov 14, 2019
af48ffd
survey: clearly note the experimental nature in the output
dscho Jul 1, 2024
7177d71
compat/mingw: handle WSA errors in strerror
rimrul Dec 22, 2024
03f488e
Merge branch 'g4w-hot-fixes'
dscho Feb 26, 2025
c231701
compat/mingw: drop outdated comment
rimrul Dec 22, 2024
d395a62
Merge branch 'ci-fixes'
dscho Feb 11, 2021
d3f933f
t0301: actually test credential-cache on Windows
rimrul Dec 29, 2024
6dff17f
Merge 'remote-hg-prerequisites' into HEAD
dscho Jun 8, 2018
8ad478c
credential-cache: handle ECONNREFUSED gracefully
rimrul Dec 22, 2024
0289c0f
mingw_open_existing: handle directories better
rimrul Jan 4, 2025
2f6830d
Merge branch 'drive-prefix'
dscho Jun 8, 2018
5ddda17
Merge branch 'dont-clean-junctions'
dscho Jul 30, 2019
7b8dbbd
Merge branch 'msys2-python'
dscho May 31, 2019
05c5b29
Merge branch 'mimalloc-v2.0.9'
dscho Sep 8, 2022
4997759
Merge pull request #2375 from assarbad/reintroduce-sideband-config
dscho Oct 30, 2019
1c82e2b
Merge pull request #2449 from dscho/mingw-getcwd-and-symlinks
dscho Jan 3, 2020
77fcc70
Merge pull request #2488 from bmueller84/master
dscho Jan 22, 2020
a640680
Merge pull request #2501 from jeffhostetler/clink-debug-curl
dscho Jan 30, 2020
df015a2
Merge pull request #2504 from dscho/access-repo-via-junction
dscho Feb 1, 2020
372a6c1
Merge pull request #2506 from dscho/issue-2283
dscho Feb 11, 2020
9bd0989
Merge pull request #2535 from dscho/schannel-revoke-best-effort
dscho Mar 4, 2020
276b525
Merge pull request #2618 from dscho/avoid-d/f-conflict-in-vs/master
dscho May 9, 2020
8bfa86b
Merge 'add-p-many-files'
dscho Jun 8, 2018
515253d
Merge pull request #2730 from dscho/crlf-aware-git-add-i
dscho Jul 2, 2020
f7ac9e5
Merge pull request #2714 from lbonanomi/crlf-scissors
dscho Jul 3, 2020
d209601
Merge pull request #2655 from jglathe/jg/t0014_trace_extra_info
dscho Oct 9, 2020
a09544c
Merge 'git-gui/js/intent-to-add'
dscho Oct 18, 2020
19ff4fd
Merge pull request #2974 from derrickstolee/maintenance-and-headless
dscho Jan 11, 2021
6e4c434
cmake: install headless-git. (#4338)
dscho Mar 13, 2023
67271ab
Merge pull request #2351 from PhilipOakley/vcpkg-tip
dscho Oct 7, 2019
4ac711b
Merge pull request #2915 from dennisameling/windows-arm64-support
dscho Dec 9, 2020
be14c9e
Merge pull request #3327 from dennisameling/fix-host-cpu
dscho Jul 19, 2021
66ef1c9
Merge pull request #3165 from dscho/increase-allowed-length-of-interp…
dscho Apr 3, 2021
9a95cb4
Merge pull request #3220 from dscho/there-is-no-vs/master-anymore
dscho May 17, 2021
e65bb84
Merge pull request #3293 from pascalmuller/http-support-automatically…
dscho Jun 24, 2021
ff034b8
Merge pull request #3349 from vdye/feature/ci-subtree-tests
dscho Aug 10, 2021
ea98c5d
Merge pull request #3306 from PhilipOakley/vs-sln
dscho Oct 12, 2021
ce62b8c
Merge pull request #3417 from dscho/initialize-core.symlinks-earlier
dscho Oct 13, 2021
721cba1
Merge pull request #3533 from PhilipOakley/hashliteral_t
dscho Dec 15, 2021
cf888e4
Merge pull request #3791: Various fixes around `safe.directory`
derrickstolee Apr 13, 2022
6e4eeaa
Merge pull request #3751 from rkitover/native-term
dscho Apr 21, 2022
fd93879
Merge pull request #3875 from 1480c1/wine/detect_msys_tty
dscho May 30, 2022
625a117
Merge branch 'optionally-dont-append-atomically-on-windows'
dscho Jun 23, 2022
e1073d3
Merge branch 'fsync-object-files-always'
dscho Oct 11, 2018
5ba2a0b
Merge pull request #3942 from rimrul/mingw-tsaware
dscho Jul 27, 2022
73934aa
Fix Windows version resources (#4092)
dscho Nov 3, 2022
8348939
Merge branch 'builtin-swap-functions'
dscho Nov 23, 2022
100dceb
Add support for CLANGARM64 target (#3916)
dscho Oct 28, 2022
6d19c24
Fix global repository field not being cleared (#4083)
dscho Dec 20, 2022
92999e8
Skip linking the "dashed" `git-<command>`s for built-ins (#4252)
dscho Jan 31, 2023
39cbca4
Git GUI: fix Repository>Explore Working Copy (#4357)
dscho Mar 21, 2023
e9e8dce
Lazy load libcurl, allowing for an SSL/TLS backend-specific libcurl (…
dscho May 15, 2023
6dc1a84
Merge branch 'nano-server'
dscho Aug 7, 2023
49756cb
Additional error checks for issuing the windows.appendAtomically warn…
dscho Aug 7, 2023
6bdb1b0
win32: use native ANSI sequence processing, if possible (#4700)
dscho Dec 2, 2023
451ffcb
ARM64: Embed manifest properly (#4718)
dscho Dec 7, 2023
396e416
common-main.c: fflush stdout buffer when exit (#4901)
dscho Apr 12, 2024
2594a4d
Merge branch 'run-t5601-and-t7406-with-symlinks-on-windows-10'
dscho Jul 12, 2024
97176a3
Merge branch 'Fix-i686-build-with-GCC-v14'
dscho Jul 12, 2024
1148790
Merge branch 'Fallback-to-AppData-if-XDG-CONFIG-HOME-is-unset'
dscho Jul 12, 2024
71c8f2f
Merge branch 'run-command-be-helpful-when-Git-LFS-fails-on-Windows-7'
dscho Jul 12, 2024
3983b09
pack-objects: create new name-hash algorithm (#5157)
dscho Sep 24, 2024
9376ef9
Add path walk API and its use in 'git pack-objects' (#5171)
derrickstolee Sep 25, 2024
ae1f394
Add experimental 'git survey' builtin (#5174)
dscho Sep 26, 2024
b41726a
credential-cache: handle ECONNREFUSED gracefully (#5329)
dscho Jan 1, 2025
d2dc2fd
mingw_open_existing: handle directories better (#5342)
dscho Jan 23, 2025
476397c
mingw: drop Windows 7-specific work-around
dscho Mar 4, 2025
9634c6d
Drop support for `core.restrictInheritedHandles`, as it targeted Wind…
dscho Mar 4, 2025
77e6ffa
git-gui: provide question helper for retry fallback on Windows
hvoigt Feb 21, 2010
e88938d
git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
dscho Jul 23, 2010
a745957
Merge branch 'ready-for-upstream'
dscho Oct 11, 2018
bdb92b8
git-gui--askyesno: fix funny text wrapping
dscho Sep 20, 2017
27d04bc
git-gui--askyesno: allow overriding the window title
dscho Sep 20, 2017
6d6c6f0
git-gui--askyesno (mingw): use Git for Windows' icon, if available
dscho Sep 20, 2017
fd76c5f
Merge 'git-gui' into HEAD
dscho Jun 7, 2018
4ce43b6
Win32: make FILETIME conversion functions public
kblees Jul 6, 2013
caf2b0a
Merge branch 'git-gui-askyesno'
dscho Jun 8, 2018
0006110
Win32: dirent.c: Move opendir down
kblees Sep 8, 2013
0ef4ce7
mingw: make the dirent implementation pluggable
kblees Sep 8, 2013
e1da3ef
Win32: make the lstat implementation pluggable
kblees Sep 8, 2013
91e523c
mingw: add infrastructure for read-only file system level caches
kblees Sep 8, 2013
b66faf4
mingw: add a cache below mingw's lstat and dirent implementations
kblees Oct 1, 2013
52df2a6
fscache: load directories only once
kblees Jun 24, 2014
69ccf64
fscache: add key for GIT_TRACE_FSCACHE
jeffhostetler Jan 24, 2017
f907fe2
fscache: remember not-found directories
jeffhostetler Dec 13, 2016
a43584f
fscache: add a test for the dir-not-found optimization
dscho Jan 25, 2017
6da2523
add: use preload-index and fscache for performance
jeffhostetler Nov 22, 2016
f2243c0
dir.c: make add_excludes aware of fscache during status
jeffhostetler Nov 1, 2017
2a30752
fscache: make fscache_enabled() public
jeffhostetler Dec 20, 2017
b7f14f4
dir.c: regression fix for add_excludes with fscache
jeffhostetler Dec 20, 2017
d93864f
fetch-pack.c: enable fscache for stats under .git/objects
Nov 22, 2017
1afd4d1
checkout.c: enable fscache for checkout again
Jan 30, 2018
567bc0e
Enable the filesystem cache (fscache) in refresh_index().
benpeart Sep 7, 2018
7fa7857
fscache: use FindFirstFileExW to avoid retrieving the short name
benpeart Oct 23, 2018
76a6f4e
fscache: add GIT_TEST_FSCACHE support
benpeart Oct 4, 2018
c86a8ee
fscache: add fscache hit statistics
benpeart Sep 25, 2018
06b0fd2
unpack-trees: enable fscache for sparse-checkout
derrickstolee Jun 12, 2019
4e356be
mem_pool: add GIT_TRACE_MEMPOOL support
benpeart Oct 4, 2018
a717aa2
fscache: fscache takes an initial size
benpeart Nov 2, 2018
195823c
fscache: update fscache to be thread specific instead of global
benpeart Oct 4, 2018
aa03aec
fscache: teach fscache to use mempool
benpeart Nov 2, 2018
204682a
status: disable and free fscache at the end of the status command
benpeart Nov 1, 2018
d675ef6
fscache: make fscache_enable() thread safe
benpeart Nov 16, 2018
98508c4
fscache: remember the reparse tag for each entry
dscho Dec 11, 2018
d5408e2
fscache: teach fscache to use NtQueryDirectoryFile
benpeart Nov 15, 2018
35402aa
fscache: implement an FSCache-aware is_mount_point()
dscho Dec 11, 2018
b082d9a
Merge branch 'fscache'
dscho Nov 15, 2018
6a1bbc5
clean: make use of FSCache
dscho Dec 11, 2018
95a339b
Merge pull request #1909 from benpeart/free-fscache-after-status-gfw
dscho Nov 5, 2018
fc1212e
Merge remote-tracking branch 'benpeart/fscache-per-thread-gfw'
dscho Nov 16, 2018
1095b7a
Merge branch 'dont-clean-junctions-fscache'
dscho Jul 23, 2019
533ca70
pack-objects (mingw): demonstrate a segmentation fault with large deltas
vangdfang Jan 9, 2014
e7be1a8
mingw: support long paths
kblees Jul 28, 2015
60d5b86
Win32: fix 'lstat("dir/")' with long paths
kblees Jul 4, 2014
ce39e53
win32(long path support): leave drive-less absolute paths intact
dscho Sep 6, 2023
017eb18
mingw: Support `git_terminal_prompt` with more terminals
kblees Mar 19, 2015
b63ace6
compat/fsmonitor/fsm-*-win32: support long paths
jeffhostetler Mar 25, 2022
0ac8991
compat/terminal.c: only use the Windows console if bash 'read -r' fails
kblees May 9, 2015
66325a9
clean: suggest using `core.longPaths` if paths are too long to remove
mathstuf Apr 22, 2022
6d2c55f
mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method
dscho Feb 23, 2018
d33eaab
strbuf_readlink: don't call readlink twice if hint is the exact link …
kblees May 11, 2015
97afcca
strbuf_readlink: support link targets that exceed PATH_MAX
kblees May 11, 2015
78f9a93
lockfile.c: use is_dir_sep() instead of hardcoded '/' checks
kblees May 11, 2015
98268ac
Win32: don't call GetFileAttributes twice in mingw_lstat()
kblees May 12, 2015
49f29c6
Win32: implement stat() with symlink support
kblees May 15, 2015
fb80ff4
Win32: remove separate do_lstat() function
kblees May 11, 2015
add4869
Win32: let mingw_lstat() error early upon problems with reparse points
kblees May 23, 2015
3146546
mingw: teach fscache and dirent about symlinks
kblees Jan 10, 2017
17a64ab
Win32: lstat(): return adequate stat.st_size for symlinks
kblees May 15, 2015
08d5b2d
Win32: factor out retry logic
kblees May 19, 2015
248d448
Win32: change default of 'core.symlinks' to false
kblees May 23, 2015
ef84cd5
Win32: add symlink-specific error codes
kblees May 15, 2015
735660b
Win32: mingw_unlink: support symlinks to directories
kblees May 23, 2015
7fffc73
Win32: mingw_rename: support renaming symlinks
kblees May 19, 2015
3581959
Win32: mingw_chdir: change to symlink-resolved directory
kblees May 23, 2015
fafe98a
Win32: implement readlink()
kblees May 23, 2015
22b23bf
mingw: lstat: compute correct size for symlinks
billziss-gh May 28, 2020
b10726b
Win32: implement basic symlink() functionality (file symlinks only)
kblees May 23, 2015
d11a53b
Win32: symlink: add support for symlinks to directories
kblees May 23, 2015
4e8ab91
mingw: try to create symlinks without elevated permissions
dscho May 30, 2017
bb3c8b3
mingw: emulate stat() a little more faithfully
dscho Mar 2, 2020
c6090f4
mingw: special-case index entries for symlinks with buggy size
dscho Jun 4, 2020
24bbcdd
mingw: introduce code to detect whether we're inside a Windows container
ZCube Apr 23, 2018
b5850ed
mingw: when running in a Windows container, try to rename() harder
ZCube Apr 23, 2018
1a26567
Win32: symlink: move phantom symlink creation to a separate function
piscisaureus Oct 26, 2018
9a1ae98
mingw: move the file_attr_to_st_mode() function definition
ZCube Apr 23, 2018
41a000a
Introduce helper to create symlinks that knows about index_state
dscho Feb 11, 2019
76382f5
mingw: Windows Docker volumes are *not* symbolic links
dscho Apr 23, 2018
7f0c15d
mingw: work around rename() failing on a read-only file
dsl101 Jul 28, 2023
16291ac
mingw: explicitly specify with which cmd to prefix the cmdline
dscho Jul 20, 2017
6cf9814
mingw: when path_lookup() failed, try BusyBox
dscho Jul 20, 2017
1055451
test-lib: avoid unnecessary Perl invocation
dscho Aug 5, 2017
ab17835
test-tool: learn to act as a drop-in replacement for `iconv`
dscho Jul 20, 2017
a8f7ece
tests(mingw): if `iconv` is unavailable, use `test-helper --iconv`
dscho Jul 20, 2017
508143e
gitattributes: mark .png files as binary
dscho Oct 11, 2018
b55b5a5
mingw: allow to specify the symlink type in .gitattributes
piscisaureus Oct 26, 2018
8d4db43
tests: move test PNGs into t/lib-diff/
dscho Aug 5, 2017
5fb6b65
Win32: symlink: add test for `symlink` attribute
piscisaureus Oct 26, 2018
dbce74a
tests: only override sort & find if there are usable ones in /usr/bin/
dscho Jul 17, 2017
b512e39
tests: use the correct path separator with BusyBox
dscho Nov 19, 2018
4c53b54
mingw: only use Bash-ism `builtin pwd -W` when available
dscho Jun 29, 2017
ad6c072
tests (mingw): remove Bash-specific pwd option
dscho Jun 30, 2017
d060e71
test-lib: add BUSYBOX prerequisite
dscho Jul 19, 2017
e995516
t5003: use binary file from t/lib-diff/
dscho Aug 5, 2017
54267a9
t5532: workaround for BusyBox on Windows
dscho Jul 21, 2017
f0d28e8
t5605: special-case hardlink test for BusyBox-w32
dscho Jul 21, 2017
4f8d17d
t5813: allow for $PWD to be a Windows path
dscho Jul 5, 2017
045f9d0
t9200: skip tests when $PWD contains a colon
dscho Jul 7, 2017
18b03bb
mingw: kill child processes in a gentler way
dscho May 17, 2017
0beb9b0
mingw: add a Makefile target to copy test artifacts
dscho Jul 19, 2017
3954adb
mingw: optionally enable wsl compability file mode bits
swigger Jun 7, 2023
6fd5c34
mingw: really handle SIGINT
dscho Apr 22, 2018
0f7f3e8
mingw: do not call xutftowcs_path in mingw_mktemp
neerajsi-msft Oct 27, 2021
9f5a049
Add a GitHub workflow to monitor component updates
dscho Sep 29, 2020
a557683
Partially un-revert "editor: save and reset terminal after calling ED…
dscho Nov 25, 2021
0afea6a
reset: reinstate support for the deprecated --stdin option
dscho Dec 10, 2019
2265948
fsmonitor: reintroduce core.useBuiltinFSMonitor
vdye Apr 4, 2022
54961d3
dependabot: help keeping GitHub Actions versions up to date
dscho Feb 6, 2024
b9bce03
Describe Git for Windows' architecture [no ci]
dscho Feb 13, 2023
c1a6265
Modify the Code of Conduct for Git for Windows
dscho Oct 11, 2019
25d518b
CONTRIBUTING.md: add guide for first-time contributors
derrickstolee Mar 1, 2018
fa34822
README.md: Add a Windows-specific preamble
dscho Jan 10, 2014
bd43baa
Add an issue template
shiftkey Feb 18, 2016
048e0ef
Modify the GitHub Pull Request template (to reflect Git for Windows)
Dec 22, 2017
a0bcf4e
Merge branch 'gitk-and-git-gui-patches'
dscho Oct 11, 2018
68b01b3
SECURITY.md: document Git for Windows' policies
dscho Aug 23, 2019
732ea77
Merge branch 'long-paths'
dscho Nov 15, 2018
7ae3df4
Merge branch 'msys2'
dscho Nov 15, 2018
b6bc6b6
Merge branch 'kblees/kb/symlinks'
dscho Nov 15, 2018
621581f
Merge 'docker-volumes-are-no-symlinks'
dscho Oct 12, 2018
f980948
mingw: try resetting the read-only bit if rename fails (#4527)
dscho Aug 7, 2023
13a9c1b
Merge pull request #1897 from piscisaureus/symlink-attr
dscho Oct 31, 2018
8cfacf1
Merge branch 'busybox-w32'
dscho Feb 7, 2019
a7f1c43
Merge branch 'wsl-file-mode-bits'
dscho Aug 7, 2023
f1bca4c
Merge pull request #1170 from dscho/mingw-kill-process
dscho Oct 11, 2018
f2b5e18
Merge pull request #3492 from dscho/ns/batched-fsync
vdye Oct 28, 2021
67cdced
Merge branch 'un-revert-editor-save-and-reset'
dscho Jan 15, 2022
30ee11c
Merge branch 'phase-out-reset-stdin'
dscho Jun 8, 2018
7e67726
Merge branch 'deprecate-core.useBuiltinFSMonitor'
dscho Jan 24, 2023
9a042e6
Merge pull request #2837 from dscho/monitor-component-updates
dscho Oct 7, 2020
3196303
Merge 'readme' into HEAD
dscho Jun 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Documentation/git-reset.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ SYNOPSIS
'git reset' [-q] [--pathspec-from-file=<file> [--pathspec-file-nul]] [<tree-ish>]
'git reset' (--patch | -p) [<tree-ish>] [--] [<pathspec>...]
'git reset' [--soft | --mixed [-N] | --hard | --merge | --keep] [-q] [<commit>]
DEPRECATED: 'git reset' [-q] [--stdin [-z]] [<tree-ish>]

DESCRIPTION
-----------
Expand Down Expand Up @@ -133,6 +134,16 @@ OPTIONS
+
For more details, see the 'pathspec' entry in linkgit:gitglossary[7].

--stdin::
DEPRECATED (use `--pathspec-from-file=-` instead): Instead of taking
list of paths from the command line, read list of paths from the
standard input. Paths are separated by LF (i.e. one path per line) by
default.

-z::
DEPRECATED (use `--pathspec-file-nul` instead): Only meaningful with
`--stdin`; paths are separated with NUL character instead of LF.

EXAMPLES
--------

Expand Down
16 changes: 16 additions & 0 deletions builtin/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "trace2.h"
#include "dir.h"
#include "add-interactive.h"
#include "strbuf.h"
#include "quote.h"

#define REFRESH_INDEX_DELAY_WARNING_IN_MS (2 * 1000)

Expand All @@ -46,6 +48,7 @@ static const char * const git_reset_usage[] = {
N_("git reset [-q] [<tree-ish>] [--] <pathspec>..."),
N_("git reset [-q] [--pathspec-from-file [--pathspec-file-nul]] [<tree-ish>]"),
N_("git reset --patch [<tree-ish>] [--] [<pathspec>...]"),
N_("DEPRECATED: git reset [-q] [--stdin [-z]] [<tree-ish>]"),
NULL
};

Expand Down Expand Up @@ -346,6 +349,7 @@ int cmd_reset(int argc,
struct object_id oid;
struct pathspec pathspec;
int intent_to_add = 0;
int nul_term_line = 0, read_from_stdin = 0;
const struct option options[] = {
OPT__QUIET(&quiet, N_("be quiet, only report errors")),
OPT_BOOL(0, "no-refresh", &no_refresh,
Expand Down Expand Up @@ -374,6 +378,10 @@ int cmd_reset(int argc,
N_("record only the fact that removed paths will be added later")),
OPT_PATHSPEC_FROM_FILE(&pathspec_from_file),
OPT_PATHSPEC_FILE_NUL(&pathspec_file_nul),
OPT_BOOL('z', NULL, &nul_term_line,
N_("DEPRECATED (use --pathspec-file-nul instead): paths are separated with NUL character")),
OPT_BOOL(0, "stdin", &read_from_stdin,
N_("DEPRECATED (use --pathspec-from-file=- instead): read paths from <stdin>")),
OPT_END()
};

Expand All @@ -383,6 +391,14 @@ int cmd_reset(int argc,
PARSE_OPT_KEEP_DASHDASH);
parse_args(&pathspec, argv, prefix, patch_mode, &rev);

if (read_from_stdin) {
warning(_("--stdin is deprecated, please use --pathspec-from-file=- instead"));
free(pathspec_from_file);
pathspec_from_file = xstrdup("-");
if (nul_term_line)
pathspec_file_nul = 1;
}

if (pathspec_from_file) {
if (patch_mode)
die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch");
Expand Down
1 change: 1 addition & 0 deletions t/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@ integration_tests = [
't7105-reset-patch.sh',
't7106-reset-unborn-branch.sh',
't7107-reset-pathspec-file.sh',
't7108-reset-stdin.sh',
't7110-reset-merge.sh',
't7111-reset-table.sh',
't7112-reset-submodule.sh',
Expand Down
32 changes: 32 additions & 0 deletions t/t7108-reset-stdin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

test_description='reset --stdin'

. ./test-lib.sh

test_expect_success 'reset --stdin' '
test_commit hello &&
git rm hello.t &&
test -z "$(git ls-files hello.t)" &&
echo hello.t | git reset --stdin &&
test hello.t = "$(git ls-files hello.t)"
'

test_expect_success 'reset --stdin -z' '
test_commit world &&
git rm hello.t world.t &&
test -z "$(git ls-files hello.t world.t)" &&
printf world.tQworld.tQhello.tQ | q_to_nul | git reset --stdin -z &&
printf "hello.t\nworld.t\n" >expect &&
git ls-files >actual &&
test_cmp expect actual
'

test_expect_success '--stdin requires --mixed' '
echo hello.t >list &&
test_must_fail git reset --soft --stdin <list &&
test_must_fail git reset --hard --stdin <list &&
git reset --mixed --stdin <list
'

test_done