Skip to content

Commit 803b5ac

Browse files
committed
Merge branch 'ps/3.0-remote-deprecation'
Following the procedure we established to introduce breaking changes for Git 3.0, allow an early opt-in for removing support of $GIT_DIR/branches/ and $GIT_DIR/remotes/ directories to configure remotes. * ps/3.0-remote-deprecation: remote: announce removal of "branches/" and "remotes/" builtin/pack-redundant: remove subcommand with breaking changes ci: repurpose "linux-gcc" job for deprecations ci: merge linux-gcc-default into linux-gcc Makefile: wire up build option for deprecated features
2 parents c43136d + 8ccc75c commit 803b5ac

21 files changed

+132
-59
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,8 @@ jobs:
265265
- jobname: linux-reftable
266266
cc: clang
267267
pool: ubuntu-latest
268-
- jobname: linux-gcc
268+
- jobname: linux-breaking-changes
269269
cc: gcc
270-
cc_package: gcc-8
271270
pool: ubuntu-20.04
272271
- jobname: linux-TEST-vars
273272
cc: gcc
@@ -285,9 +284,6 @@ jobs:
285284
- jobname: osx-meson
286285
cc: clang
287286
pool: macos-13
288-
- jobname: linux-gcc-default
289-
cc: gcc
290-
pool: ubuntu-latest
291287
- jobname: linux-leaks
292288
cc: gcc
293289
pool: ubuntu-latest

.gitlab-ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,13 @@ test:linux:
4545
- jobname: linux-reftable
4646
image: ubuntu:latest
4747
CC: clang
48-
- jobname: linux-gcc
48+
- jobname: linux-breaking-changes
4949
image: ubuntu:20.04
5050
CC: gcc
51-
CC_PACKAGE: gcc-8
5251
- jobname: linux-TEST-vars
5352
image: ubuntu:20.04
5453
CC: gcc
5554
CC_PACKAGE: gcc-8
56-
- jobname: linux-gcc-default
57-
image: ubuntu:latest
58-
CC: gcc
5955
- jobname: linux-leaks
6056
image: ubuntu:latest
6157
CC: gcc

Documentation/BreakingChanges.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,31 @@ Cf. <[email protected]>,
154154
<CAKvOHKAFXQwt4D8yUCCkf_TQL79mYaJ=KAKhtpDNTvHJFuX1NA@mail.gmail.com>,
155155
156156

157+
* Support for storing shorthands for remote URLs in "$GIT_COMMON_DIR/branches/"
158+
and "$GIT_COMMON_DIR/remotes/" has been long superseded by storing remotes in
159+
the repository configuration.
160+
+
161+
The mechanism has originally been introduced in f170e4b39d ([PATCH] fetch/pull:
162+
short-hand notation for remote repositories., 2005-07-16) and was superseded by
163+
6687f8fea2 ([PATCH] Use .git/remote/origin, not .git/branches/origin.,
164+
2005-08-20), where we switched from ".git/branches/" to ".git/remotes/". That
165+
commit already mentions an upcoming deprecation of the ".git/branches/"
166+
directory, and starting with a1d4aa7424 (Add repository-layout document.,
167+
2005-09-01) we have also marked this layout as deprecated. Eventually we also
168+
started to migrate away from ".git/remotes/" in favor of config-based remotes,
169+
and we have marked the directory as legacy in 3d3d282146 (Documentation:
170+
Grammar correction, wording fixes and cleanup, 2011-08-23)
171+
+
172+
As our documentation mentions, these directories are not to be found in modern
173+
repositories at all and most users aren't even aware of these mechanisms. They
174+
have been deprecated for almost 20 years and 14 years respectively, and we are
175+
not aware of any active users that have complained about this deprecation.
176+
Furthermore, the ".git/branches/" directory is nowadays misleadingly named and
177+
may cause confusion as "branches" are almost exclusively used in the context of
178+
references.
179+
+
180+
These features will be removed.
181+
157182
== Superseded features that will not be deprecated
158183

159184
Some features have gained newer replacements that aim to improve the design in

Documentation/gitrepository-layout.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ config.worktree::
153153
linkgit:git-worktree[1]).
154154

155155
branches::
156-
A slightly deprecated way to store shorthands to be used
156+
A deprecated way to store shorthands to be used
157157
to specify a URL to 'git fetch', 'git pull' and 'git push'.
158158
A file can be stored as `branches/<name>` and then
159159
'name' can be given to these commands in place of
@@ -162,7 +162,8 @@ branches::
162162
and not likely to be found in modern repositories. This
163163
directory is ignored if $GIT_COMMON_DIR is set and
164164
"$GIT_COMMON_DIR/branches" will be used instead.
165-
165+
+
166+
Git will stop reading remotes from this directory in Git 3.0.
166167

167168
hooks::
168169
Hooks are customization scripts used by various Git
@@ -238,6 +239,8 @@ remotes::
238239
and not likely to be found in modern repositories. This
239240
directory is ignored if $GIT_COMMON_DIR is set and
240241
"$GIT_COMMON_DIR/remotes" will be used instead.
242+
+
243+
Git will stop reading remotes from this directory in Git 3.0.
241244

242245
logs::
243246
Records of changes made to refs are stored in this directory.

GIT-BUILD-OPTIONS.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ TEST_OUTPUT_DIRECTORY=@TEST_OUTPUT_DIRECTORY@
4545
TEST_SHELL_PATH=@TEST_SHELL_PATH@
4646
USE_GETTEXT_SCHEME=@USE_GETTEXT_SCHEME@
4747
USE_LIBPCRE2=@USE_LIBPCRE2@
48+
WITH_BREAKING_CHANGES=@WITH_BREAKING_CHANGES@
4849
X=@X@

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,9 @@ BUILTIN_OBJS += builtin/mv.o
12731273
BUILTIN_OBJS += builtin/name-rev.o
12741274
BUILTIN_OBJS += builtin/notes.o
12751275
BUILTIN_OBJS += builtin/pack-objects.o
1276+
ifndef WITH_BREAKING_CHANGES
12761277
BUILTIN_OBJS += builtin/pack-redundant.o
1278+
endif
12771279
BUILTIN_OBJS += builtin/pack-refs.o
12781280
BUILTIN_OBJS += builtin/patch-id.o
12791281
BUILTIN_OBJS += builtin/prune-packed.o
@@ -2236,6 +2238,10 @@ ifdef FSMONITOR_OS_SETTINGS
22362238
COMPAT_OBJS += compat/fsmonitor/fsm-path-utils-$(FSMONITOR_OS_SETTINGS).o
22372239
endif
22382240

2241+
ifdef WITH_BREAKING_CHANGES
2242+
BASIC_CFLAGS += -DWITH_BREAKING_CHANGES
2243+
endif
2244+
22392245
ifeq ($(TCLTK_PATH),)
22402246
NO_TCLTK = NoThanks
22412247
endif
@@ -3194,6 +3200,7 @@ GIT-BUILD-OPTIONS: FORCE
31943200
-e "s|@TEST_SHELL_PATH@|\'$(TEST_SHELL_PATH_SQ)\'|" \
31953201
-e "s|@USE_GETTEXT_SCHEME@|\'$(USE_GETTEXT_SCHEME)\'|" \
31963202
-e "s|@USE_LIBPCRE2@|\'$(USE_LIBPCRE2)\'|" \
3203+
-e "s|@WITH_BREAKING_CHANGES@|\'$(WITH_BREAKING_CHANGES)\'|" \
31973204
-e "s|@X@|\'$(X)\'|" \
31983205
GIT-BUILD-OPTIONS.in >$@+
31993206
@if grep -q '^[A-Z][A-Z_]*=@.*@$$' $@+; then echo "Unsubstituted build options in $@" >&2 && exit 1; fi

builtin/remote.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,10 +642,12 @@ static int migrate_file(struct remote *remote)
642642
strbuf_addf(&buf, "remote.%s.fetch", remote->name);
643643
for (i = 0; i < remote->fetch.nr; i++)
644644
git_config_set_multivar(buf.buf, remote->fetch.items[i].raw, "^$", 0);
645+
#ifndef WITH_BREAKING_CHANGES
645646
if (remote->origin == REMOTE_REMOTES)
646647
unlink_or_warn(git_path("remotes/%s", remote->name));
647648
else if (remote->origin == REMOTE_BRANCHES)
648649
unlink_or_warn(git_path("branches/%s", remote->name));
650+
#endif /* WITH_BREAKING_CHANGES */
649651
strbuf_release(&buf);
650652

651653
return 0;

ci/lib.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,6 @@ export SKIP_DASHED_BUILT_INS=YesPlease
329329

330330
case "$distro" in
331331
ubuntu-*)
332-
if test "$jobname" = "linux-gcc-default"
333-
then
334-
break
335-
fi
336-
337332
# Python 2 is end of life, and Ubuntu 23.04 and newer don't actually
338333
# have it anymore. We thus only test with Python 2 on older LTS
339334
# releases.

ci/run-build-and-tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ esac
1313
run_tests=t
1414

1515
case "$jobname" in
16-
linux-gcc)
16+
linux-breaking-changes)
1717
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
18+
export WITH_BREAKING_CHANGES=YesPlease
1819
;;
1920
linux-TEST-vars)
2021
export OPENSSL_SHA1_UNSAFE=YesPlease

contrib/buildsystems/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,7 @@ string(REPLACE "@TEST_OUTPUT_DIRECTORY@" "" git_build_options "${git_build_optio
12051205
string(REPLACE "@TEST_SHELL_PATH@" "'${TEST_SHELL_PATH}'" git_build_options "${git_build_options}")
12061206
string(REPLACE "@USE_GETTEXT_SCHEME@" "" git_build_options "${git_build_options}")
12071207
string(REPLACE "@USE_LIBPCRE2@" "" git_build_options "${git_build_options}")
1208+
string(REPLACE "@WITH_BREAKING_CHANGES@" "" git_build_options "${git_build_options}")
12081209
string(REPLACE "@X@" "${EXE_EXTENSION}" git_build_options "${git_build_options}")
12091210
if(USE_VCPKG)
12101211
string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n")

0 commit comments

Comments
 (0)