git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] Move rust gitcore crate to a different subdirectory

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 9, 2026, 19:54 UTC
Message-ID
<xmqqbja6qjyc.fsf@gitster.g>
In-Reply-To
<20260909013858.1729643-1-mh@glandium.org>
Mike Hommey <mh@glandium.org> writes:
Show 12 quoted lines
> 
> Having `Cargo.toml` at the top-level of the repository implies that one
> can run `cargo build` directly, but this doesn't produce anything useful
> on its own.
>
> Additionally, when including the git source as a submodule of a Rust
> project, it prevents the git source from being included at all in the
> crate package because cargo skips directories that contain a Cargo.toml,
> assuming that everything in the directory is relevant to the crate.
>
> This moves all Rust-specific files into a dedicated `rust/`
> subdirectory.

Very readable and understandable. It is customary in this project to write that last sentence in imperative mood, though. I.e. "Move all files there".

> Signed-off-by: Mike Hommey <mh@glandium.org>
Show 10 quoted lines
> diff --git a/.gitignore b/.gitignore
> index 4da58c6754..3ac0685800 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -261,3 +261,5 @@ Release/
>  /contrib/buildsystems/out
>  /contrib/libgit-rs/target
>  /contrib/libgit-sys/target
> +/rust/target
> +/rust/Cargo.lock

There are /target/ and /Cargo.lock listed in this file; aren't these two entries meant to _replace_ them? I am wondering if they need to disappear as part of this patfch.

Show 13 quoted lines
> diff --git a/Makefile b/Makefile
> index d4b775953d..7991fa378d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1571,11 +1571,13 @@ CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o
>  
>  UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o
>  
> -RUST_SOURCES += src/csum_file.rs
> -RUST_SOURCES += src/hash.rs
> -RUST_SOURCES += src/lib.rs
> -RUST_SOURCES += src/loose.rs
> -RUST_SOURCES += src/varint.rs
Show 7 quoted lines
> +RUST_SOURCES += rust/src/csum_file.rs
> +RUST_SOURCES += rust/src/hash.rs
> +RUST_SOURCES += rust/src/lib.rs
> +RUST_SOURCES += rust/src/loose.rs
> +RUST_SOURCES += rust/src/varint.rs
> +RUST_SOURCES += rust/src/lib.rs
> +RUST_SOURCES += rust/src/varint.rs

Two files, lib and varint, are listed twice here. A rebase error or something?

Show 6 quoted lines
> @@ -3913,7 +3915,7 @@ clean: profile-clean coverage-clean cocciclean
>  	$(RM) $(FUZZ_PROGRAMS)
>  	$(RM) $(SP_OBJ)
>  	$(RM) $(HCC)
> -	$(RM) -r Cargo.lock target/
> +	$(RM) -r Cargo.lock rust/target/

The Cargo.lock file does not move together with the rest? That contradicts with what .gitignore says, doesn't it?

Previous: Mike HommeyNext: Mike Hommey
Message 8 of 18 in “Move rust gitcore crate to a different subdirectory”
  1. Move rust gitcore crate to a different subdirectoryMike Hommey, Feb 4, 2026
  2. brian m. carlsonFeb 5, 2026
  3. Mike HommeyFeb 5, 2026
  4. brian m. carlsonFeb 5, 2026
  5. Mike HommeyFeb 5, 2026
  6. Move rust gitcore crate to a different subdirectoryMike Hommey, Feb 9, 2026
  7. Move rust gitcore crate to a different subdirectoryMike Hommey, Sep 9, 2026
  8. Junio C HamanoSep 9, 2026
  9. Mike HommeySep 10, 2026
  10. brian m. carlsonSep 9, 2026
  11. Mike HommeySep 10, 2026
  12. Tuomas AholaSep 10, 2026
  13. Junio C HamanoSep 10, 2026
  14. Move rust gitcore crate to a different subdirectoryMike Hommey, Sep 10, 2026
  15. Junio C HamanoSep 10, 2026
  16. move rust gitcore crate to a different subdirectoryMike Hommey, Sep 17, 2026
  17. Junio C HamanoSep 18, 2026
  18. Mike HommeySep 18, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.