Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 0 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -468,21 +468,6 @@ jobs:
- run: ci/install-dependencies.sh
- run: ci/run-static-analysis.sh
- run: ci/check-directional-formatting.bash
rust-analysis:
needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes'
env:
jobname: RustAnalysis
CI_JOB_IMAGE: ubuntu:rolling
runs-on: ubuntu-latest
container: ubuntu:rolling
concurrency:
group: rust-analysis-${{ github.ref }}
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
steps:
- uses: actions/checkout@v4
- run: ci/install-dependencies.sh
- run: ci/run-rust-checks.sh
sparse:
needs: ci-config
if: needs.ci-config.outputs.enabled == 'yes'
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,3 @@ Release/
/git.VC.db
*.dSYM
/contrib/buildsystems/out
/contrib/libgit-rs/target
/contrib/libgit-sys/target
13 changes: 1 addition & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ test:mingw64:
- saas-windows-medium-amd64
before_script:
- *windows_before_script
- choco install -y git meson ninja rust-ms
- choco install -y git meson ninja
- Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
- refreshenv

Expand Down Expand Up @@ -212,17 +212,6 @@ static-analysis:
- ./ci/run-static-analysis.sh
- ./ci/check-directional-formatting.bash

rust-analysis:
image: ubuntu:rolling
stage: analyze
needs: [ ]
variables:
jobname: RustAnalysis
before_script:
- ./ci/install-dependencies.sh
script:
- ./ci/run-rust-checks.sh

check-whitespace:
image: ubuntu:latest
stage: analyze
Expand Down
10 changes: 0 additions & 10 deletions Cargo.toml

This file was deleted.

45 changes: 0 additions & 45 deletions Documentation/BreakingChanges.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -170,52 +170,7 @@ JGit, libgit2 and Gitoxide need to support it.
provide useful advice about init.defaultBranch, 2020-12-11). The new name
matches the default branch name used in new repositories by many of the
big Git forges.

* Git will require Rust as a mandatory part of the build process. While Git
already started to adopt Rust in Git 2.49, all parts written in Rust are
optional for the time being. This includes:
+
** The Rust wrapper around libgit.a that is part of "contrib/" and which has
been introduced in Git 2.49.
** Subsystems that have an alternative implementation in Rust to test
interoperability between our C and Rust codebase.
** Newly written features that are not mission critical for a fully functional
Git client.
+
These changes are meant as test balloons to allow distributors of Git to prepare
for Rust becoming a mandatory part of the build process. There will be multiple
milestones for the introduction of Rust:
+
--
1. Initially, with Git 2.52, support for Rust will be auto-detected by Meson and
disabled in our Makefile so that the project can sort out the initial
infrastructure.
2. In Git 2.53, both build systems will default-enable support for Rust.
Consequently, builds will break by default if Rust is not available on the
build host. The use of Rust can still be explicitly disabled via build
flags.
3. In Git 3.0, the build options will be removed and support for Rust is
mandatory.
--
+
You can explicitly ask both Meson and our Makefile-based system to enable Rust
by saying `meson configure -Drust=enabled` and `make WITH_RUST=YesPlease`,
respectively.
+
The Git project will declare the last version before Git 3.0 to be a long-term
support release. This long-term release will receive important bug fixes for at
least four release cycles and security fixes for six release cycles. The Git
project will hand over maintainership of the long-term release to distributors
in case they need to extend the life of that long-term release even further.
Details of how this long-term release will be handed over to the community will
be discussed once the Git project decides to stop officially supporting it.
+
We will evaluate the impact on downstream distributions before making Rust
mandatory in Git 3.0. If we see that the impact on downstream distributions
would be significant, we may decide to defer this change to a subsequent minor
release. This evaluation will also take into account our own experience with
how painful it is to keep Rust an optional component.

=== Removals

* Support for grafting commits has long been superseded by git-replace(1).
Expand Down
6 changes: 0 additions & 6 deletions Documentation/technical/build-systems.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ by the build system:

- C: the primary compiled language used by Git, must be supported. Relevant
toolchains are GCC, Clang and MSVC.
- Rust: candidate as a second compiled lanugage, should be supported. Relevant
toolchains is the LLVM-based rustc.

Built-in support for the respective languages is preferred over support that
needs to be wired up manually to avoid unnecessary complexity. Native support
Expand Down Expand Up @@ -151,7 +149,6 @@ The following list of build systems are considered:
- Cross-platform builds: supported in theory, not wired up in practice.
- Language support:
- C: Limited built-in support, many parts need to be wired up manually.
- Rust: No built-in support, needs to be wired up manually.
- Test integration: partially supported, many parts need to be wired up
manually.

Expand All @@ -168,7 +165,6 @@ The following list of build systems are considered:
- Cross-platform builds: supported.
- Language support:
- C: Limited built-in support, many parts need to be wired up manually.
- Rust: No built-in support, needs to be wired up manually.
- Test integration: partially supported, many parts need to be wired up
manually.

Expand All @@ -194,7 +190,6 @@ The following list of build systems are considered:
- Cross-platform builds: supported.
- Language support:
- C: Supported for GCC, Clang, MSVC and other toolchains.
- Rust: No built-in support, needs to be wired up manually.
- Test integration: supported, even though test dependencies are a bit
cumbersome to use via "test fixtures". Interactive test runs are not
supported.
Expand Down Expand Up @@ -222,6 +217,5 @@ The following list of build systems are considered:
- Cross-platform builds: supported.
- Language support:
- C: Supported for GCC, Clang, MSVC and other toolchains.
- Rust: Supported for rustc.
- Test integration: supported. Interactive tests are supported starting with
Meson 1.5.0 via the `--interactive` flag.
92 changes: 0 additions & 92 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,6 @@ include shared.mak
# Define LINK_FUZZ_PROGRAMS if you want `make all` to also build the fuzz test
# programs in oss-fuzz/.
#
# Define INCLUDE_LIBGIT_RS if you want `make all` and `make test` to build and
# test the Rust crates in contrib/libgit-sys and contrib/libgit-rs.
#
# === Optional library: libintl ===
#
# Define NO_GETTEXT if you don't want Git output to be translated.
Expand Down Expand Up @@ -493,14 +490,6 @@ include shared.mak
# Define LIBPCREDIR=/foo/bar if your PCRE header and library files are
# in /foo/bar/include and /foo/bar/lib directories.
#
# == Optional Rust support ==
#
# Define WITH_RUST if you want to include features and subsystems written in
# Rust into Git. For now, Rust is still an optional feature of the build
# process. With Git 3.0 though, Rust will always be enabled.
#
# Building Rust code requires Cargo.
#
# == SHA-1 and SHA-256 defines ==
#
# === SHA-1 backend ===
Expand Down Expand Up @@ -695,13 +684,11 @@ FUZZ_OBJS =
FUZZ_PROGRAMS =
GIT_OBJS =
LIB_OBJS =
LIBGIT_PUB_OBJS =
SCALAR_OBJS =
OBJECTS =
OTHER_PROGRAMS =
PROGRAM_OBJS =
PROGRAMS =
RUST_SOURCES =
EXCLUDED_PROGRAMS =
SCRIPT_PERL =
SCRIPT_PYTHON =
Expand Down Expand Up @@ -938,18 +925,6 @@ TEST_SHELL_PATH = $(SHELL_PATH)

LIB_FILE = libgit.a

ifdef DEBUG
RUST_TARGET_DIR = target/debug
else
RUST_TARGET_DIR = target/release
endif

ifeq ($(uname_S),Windows)
RUST_LIB = $(RUST_TARGET_DIR)/gitcore.lib
else
RUST_LIB = $(RUST_TARGET_DIR)/libgitcore.a
endif

GITLIBS = common-main.o $(LIB_FILE)
EXTLIBS =

Expand All @@ -973,15 +948,6 @@ BASIC_LDFLAGS =
ARFLAGS = rcs
PTHREAD_CFLAGS =

# Rust flags
CARGO_ARGS =
ifndef V
CARGO_ARGS += --quiet
endif
ifndef DEBUG
CARGO_ARGS += --release
endif

# For the 'sparse' target
SPARSE_FLAGS ?= -std=gnu99 -D__STDC_NO_VLA__
SP_EXTRA_FLAGS =
Expand Down Expand Up @@ -1343,9 +1309,7 @@ LIB_OBJS += urlmatch.o
LIB_OBJS += usage.o
LIB_OBJS += userdiff.o
LIB_OBJS += utf8.o
ifndef WITH_RUST
LIB_OBJS += varint.o
endif
LIB_OBJS += version.o
LIB_OBJS += versioncmp.o
LIB_OBJS += walker.o
Expand Down Expand Up @@ -1545,9 +1509,6 @@ CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o

UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o

RUST_SOURCES += src/lib.rs
RUST_SOURCES += src/varint.rs

GIT-VERSION-FILE: FORCE
@OLD=$$(cat $@ 2>/dev/null || :) && \
$(call version_gen,"$(shell pwd)",GIT-VERSION-FILE.in,$@) && \
Expand Down Expand Up @@ -1577,14 +1538,6 @@ endif
ALL_CFLAGS = $(DEVELOPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_APPEND)
ALL_LDFLAGS = $(LDFLAGS) $(LDFLAGS_APPEND)

ifdef WITH_RUST
BASIC_CFLAGS += -DWITH_RUST
GITLIBS += $(RUST_LIB)
ifeq ($(uname_S),Windows)
EXTLIBS += -luserenv
endif
endif

ifdef SANITIZE
SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag))
BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
Expand Down Expand Up @@ -2382,12 +2335,6 @@ ifdef CHECK_ASSERTION_SIDE_EFFECTS
BASIC_CFLAGS += -DCHECK_ASSERTION_SIDE_EFFECTS
endif

ifdef INCLUDE_LIBGIT_RS
# Enable symbol hiding in contrib/libgit-sys/libgitpub.a without making
# us rebuild the whole tree every time we run a Rust build.
BASIC_CFLAGS += -fvisibility=hidden
endif

ifeq ($(TCLTK_PATH),)
NO_TCLTK = NoThanks
endif
Expand Down Expand Up @@ -2860,10 +2807,6 @@ OBJECTS += $(UNIT_TEST_OBJS)
OBJECTS += $(CLAR_TEST_OBJS)
OBJECTS += $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(UNIT_TEST_PROGRAMS))

ifdef INCLUDE_LIBGIT_RS
OBJECTS += contrib/libgit-sys/public_symbol_export.o
endif

ifndef NO_CURL
OBJECTS += http.o http-walker.o remote-curl.o
endif
Expand Down Expand Up @@ -3007,12 +2950,6 @@ scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS)
$(LIB_FILE): $(LIB_OBJS)
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^

$(RUST_LIB): Cargo.toml $(RUST_SOURCES)
$(QUIET_CARGO)cargo build $(CARGO_ARGS)

.PHONY: rust
rust: $(RUST_LIB)

export DEFAULT_EDITOR DEFAULT_PAGER

Documentation/GIT-EXCLUDED-PROGRAMS: FORCE
Expand Down Expand Up @@ -3868,10 +3805,6 @@ clean: profile-clean coverage-clean cocciclean
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
$(MAKE) -C Documentation/ clean
$(RM) Documentation/GIT-EXCLUDED-PROGRAMS
$(RM) -r contrib/libgit-sys/target contrib/libgit-rs/target
$(RM) contrib/libgit-sys/partial_symbol_export.o
$(RM) contrib/libgit-sys/hidden_symbol_export.o
$(RM) contrib/libgit-sys/libgitpub.a
ifndef NO_PERL
$(RM) -r perl/build/
endif
Expand Down Expand Up @@ -4033,28 +3966,3 @@ $(CLAR_TEST_PROG): $(UNIT_TEST_DIR)/clar.suite $(CLAR_TEST_OBJS) $(GITLIBS) GIT-
build-unit-tests: $(UNIT_TEST_PROGS) $(CLAR_TEST_PROG)
unit-tests: $(UNIT_TEST_PROGS) $(CLAR_TEST_PROG) t/helper/test-tool$X
$(MAKE) -C t/ unit-tests

.PHONY: libgit-sys libgit-rs
libgit-sys:
$(QUIET)cargo build --manifest-path contrib/libgit-sys/Cargo.toml
libgit-rs: libgit-sys
$(QUIET)cargo build --manifest-path contrib/libgit-rs/Cargo.toml
ifdef INCLUDE_LIBGIT_RS
all:: libgit-rs
endif

LIBGIT_PUB_OBJS += contrib/libgit-sys/public_symbol_export.o
LIBGIT_PUB_OBJS += libgit.a

LIBGIT_PARTIAL_EXPORT = contrib/libgit-sys/partial_symbol_export.o

LIBGIT_HIDDEN_EXPORT = contrib/libgit-sys/hidden_symbol_export.o

$(LIBGIT_PARTIAL_EXPORT): $(LIBGIT_PUB_OBJS)
$(LD) -r $^ -o $@

$(LIBGIT_HIDDEN_EXPORT): $(LIBGIT_PARTIAL_EXPORT)
$(OBJCOPY) --localize-hidden $^ $@

contrib/libgit-sys/libgitpub.a: $(LIBGIT_HIDDEN_EXPORT)
$(AR) $(ARFLAGS) $@ $^
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Git - fast, scalable, distributed revision control system
=========================================================

Git with WD-40 applied.

Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.
Expand Down
5 changes: 4 additions & 1 deletion builtin/am.c
Original file line number Diff line number Diff line change
Expand Up @@ -2222,6 +2222,7 @@ static void am_abort(struct am_state *state)
static int show_patch(struct am_state *state, enum resume_type resume_mode)
{
struct strbuf sb = STRBUF_INIT;
struct strbuf msgnum_sb = STRBUF_INIT;
const char *patch_path;
int len;

Expand All @@ -2236,7 +2237,8 @@ static int show_patch(struct am_state *state, enum resume_type resume_mode)

switch (resume_mode) {
case RESUME_SHOW_PATCH_RAW:
patch_path = am_path(state, msgnum(state));
strbuf_addf(&msgnum_sb, "%0*d", state->prec, state->cur);
patch_path = am_path(state, msgnum_sb.buf);
break;
case RESUME_SHOW_PATCH_DIFF:
patch_path = am_path(state, "patch");
Expand All @@ -2252,6 +2254,7 @@ static int show_patch(struct am_state *state, enum resume_type resume_mode)
setup_pager(the_repository);
write_in_full(1, sb.buf, sb.len);
strbuf_release(&sb);
strbuf_release(&msgnum_sb);
return 0;
}

Expand Down
11 changes: 0 additions & 11 deletions ci/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,6 @@ StaticAnalysis)
sudo apt-get -q -y install coccinelle libcurl4-openssl-dev libssl-dev \
libexpat-dev gettext make
;;
RustAnalysis)
sudo apt-get -q -y install rustup
rustup default stable
rustup component add clippy rustfmt

wget -q "$CARGO_MSRV_WHENCE" -O "cargo-msvc.tgz"
sudo mkdir -p "$CUSTOM_PATH"
sudo tar -xf "cargo-msvc.tgz" --strip-components=1 \
--directory "$CUSTOM_PATH" --wildcards "*/cargo-msrv"
sudo chmod a+x "$CUSTOM_PATH/cargo-msrv"
;;
sparse)
sudo apt-get -q -y install libssl-dev libcurl4-openssl-dev \
libexpat-dev gettext zlib1g-dev sparse
Expand Down
Loading