1
1
mirror of https://github.com/Byron/gitoxide synced 2025-10-06 01:52:40 +02:00

14605 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
e087960347 fix: remove special handling for empty blob hash to match Git behaviour
This feature was recently introduced, but was never released.

Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
2025-09-14 08:20:36 +02:00
Sebastian Thiel
f891c37edb Merge pull request #2168 from GitoxideLabs/copilot/fix-01a02b99-91ef-4e27-b90f-19af7d0d252c
Add `commit_raw` and `commit_as_raw` methods for creating commits without reference updates
2025-09-13 21:27:06 +02:00
Sebastian Thiel
d4c2542c2a refactor 2025-09-13 21:09:49 +02:00
Sebastian Thiel
3c0b7374f1 feat: Add Repository::new_commit and Repository::new_commit_as() methods.
Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
2025-09-13 21:09:14 +02:00
Sebastian Thiel
1a4c84dd96 Merge pull request #2167 from GitoxideLabs/copilot/fix-3952f55e-8faf-4737-886f-09e74cab4ca8
Make `gix::Repository::has_object()` consider empty blob ids to be always present
2025-09-13 19:31:14 +02:00
Sebastian Thiel
b4812d9d95 Merge pull request #2166 from GitoxideLabs/copilot/fix-ffb06a30-3f53-4f82-94ed-51935d63da63
Add `is_empty_tree()` and `is_empty_blob()` methods to `gix_hash::Oid`
2025-09-13 19:20:23 +02:00
Sebastian Thiel
689d839230 refactor 2025-09-13 19:14:44 +02:00
Sebastian Thiel
772c434483 Merge pull request #2165 from GitoxideLabs/copilot/fix-ceb7b1a4-93f5-4da1-a4f2-4290c8f594eb
Add `Kind::empty_blob()` and `Kind::empty_tree()` methods to gix-hash
2025-09-13 19:08:16 +02:00
copilot-swe-agent[bot]
2fc9dbe7e5 fix: empty blob hashes are now automatically considered present.
Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
2025-09-13 19:02:55 +02:00
Sebastian Thiel
58e2d18cd0 refactor 2025-09-13 18:58:58 +02:00
copilot-swe-agent[bot]
0f20e0a542 feat: Add oid::is_empty_tree() and oid::is_empty_blob()`. 2025-09-13 18:58:50 +02:00
Sebastian Thiel
41c40adf3d refactor 2025-09-13 18:51:11 +02:00
copilot-swe-agent[bot]
7fca001b13 feat: Add Kind::empty_blob() and Kind::empty_tree()`` methods. 2025-09-13 18:49:15 +02:00
Sebastian Thiel
42f8db5bc9 Merge pull request #2163 from cruessler/deprecate-in-place-methods
feat: replace peel_to_x_in_place by peel_to_x
2025-09-13 07:31:19 +02:00
Sebastian Thiel
382dc5dc02 Merge pull request #2164 from GitoxideLabs/improvements
fix: make non-UTF8 unified diffs possible again.
2025-09-12 16:39:12 +02:00
Sebastian Thiel
e4eb98e2dc fix: make non-UTF8 unified diffs possible again. 2025-09-12 16:21:23 +02:00
Christoph Rüßler
44922d0a71 Adapt to changes in gix-ref 2025-09-12 11:31:36 +02:00
Christoph Rüßler
e179f825f7 feat: replace peel_to_x_in_place by peel_to_x 2025-09-12 11:31:36 +02:00
Sebastian Thiel
a78bf84c03 Merge pull request #2158 from GitoxideLabs/improvements
improvements
2025-09-10 16:56:10 +02:00
Sebastian Thiel
e25ccbf387 validate what happens if a rename is emulated, particularly in relation to directory creation. 2025-09-10 16:39:46 +02:00
Sebastian Thiel
f4e630f3c6 fix: compare symlinks with blobs as long as these aren't read from the worktree (without support) 2025-09-10 16:35:17 +02:00
Sebastian Thiel
92226667cf Merge pull request #2157 from cruessler/more-impl-from-for-unblamed-hunk
Reduce noise in `gix-blame` tests
2025-09-09 09:21:46 +02:00
Christoph Rüßler
58cb884605 Reduce noise in gix-blame tests 2025-09-09 07:58:41 +02:00
Sebastian Thiel
c78af3c4d7 Merge pull request #2156 from cruessler/impl-from-for-unblamed-hunk
Reduce noise in `gix-blame` tests
2025-09-08 04:30:13 +02:00
Christoph Rüßler
4ad2be8043 Reduce noise in gix-blame tests 2025-09-07 14:57:29 +02:00
Sebastian Thiel
bd47fb5b5d Merge pull request #2153 from cruessler/add-blame-file-on-repository
Add `Repository::blame_file()`
2025-09-07 10:30:51 +02:00
Sebastian Thiel
3c54e5b8d3 Add blame to extras, and asssure it's tested separately on CI 2025-09-07 10:09:38 +02:00
Sebastian Thiel
752d6dc830 Merge pull request #2155 from folkertdev/skip-flate2
in `gix-features`, use `libz-rs-sys` directly, skipping `flate2`
2025-09-07 09:48:16 +02:00
Sebastian Thiel
e5a74876fd Don't box compression/decompression type and avoid indirections and allocs 2025-09-07 09:29:43 +02:00
Sebastian Thiel
f47f3e42b9 fix!: remove unused and previously deprecated zlib related features.
We now use `zlib-rs` directly.
2025-09-07 09:29:43 +02:00
Sebastian Thiel
0e7aa815db refactor
* Thanks clippy
* typed errors
2025-09-07 09:29:41 +02:00
Folkert de Vries
5a2361b42b in gix-features, use libz-rs-sys directly, skipping flate2 2025-09-06 20:55:49 +02:00
Sebastian Thiel
768164a877 Merge pull request #2154 from folkertdev/fix-gix-blame-performance-regression
fix `gix-blame` performance regresion
2025-09-06 19:18:42 +02:00
Christoph Rüßler
cdb1100d7e feat: add Repository::blame_file 2025-09-06 18:52:24 +02:00
Folkert de Vries
8dc5e98d9d fix gix-blame performance regresion
The issue was introduced in https://github.com/GitoxideLabs/gitoxide/pull/1963, and incorrectly assumed that the `max-performance-safe` feature flag was only used to enable other feature flags. But this feature flag is itself used in various places, so failing to enable it leads to worse codegen. This issue was discussed/found in https://github.com/GitoxideLabs/gitoxide/issues/2148
2025-09-06 16:37:33 +02:00
Christoph Rüßler
1ad3da6196 Fix typo, add missing slashes 2025-09-05 13:41:18 +02:00
Eliah Kagan
f7bfff4cd9 Merge pull request #2150 from GitoxideLabs/dependabot/cargo/cargo-f19b0f46bb
Bump the cargo group across 1 directory with 3 updates

(As commented in #2150, this doesn't really update `tracing-forest`.)
2025-09-01 20:56:25 -04:00
dependabot[bot]
b1e985de57 Bump the cargo group across 1 directory with 3 updates
Bumps the cargo group with 3 updates in the / directory: [tracing-forest](https://github.com/QnnOkabayashi/tracing-forest), [zip](https://github.com/zip-rs/zip2) and [cc](https://github.com/rust-lang/cc-rs).


Updates `tracing-forest` from 0.1.6 to 0.2.0
- [Commits](https://github.com/QnnOkabayashi/tracing-forest/commits)

Updates `zip` from 4.5.0 to 4.6.0
- [Release notes](https://github.com/zip-rs/zip2/releases)
- [Changelog](https://github.com/zip-rs/zip2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zip-rs/zip2/compare/v4.5.0...v4.6.0)

Updates `cc` from 1.2.34 to 1.2.35
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.34...cc-v1.2.35)

---
updated-dependencies:
- dependency-name: tracing-forest
  dependency-version: 0.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
- dependency-name: zip
  dependency-version: 4.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
- dependency-name: cc
  dependency-version: 1.2.35
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-01 20:10:32 +00:00
Sebastian Thiel
41b18d8aa2 Merge pull request #2147 from GitoxideLabs/improvements
fix: consider a Windows resource untrusted if security information could not be retrieved (#2128)
2025-08-31 20:01:05 +02:00
Sebastian Thiel
0bd262dba8 Improve description of the workaround.
Co-authored-by: Eliah Kagan <degeneracypressure@gmail.com>
2025-08-31 19:41:58 +02:00
Sebastian Thiel
641a89ca76 fix: consider a Windows resource untrusted if security information could not be retrieved (#2128)
Here is the full text of the analysis by Eliah Kagan:

----

Although I'm signed in to Discord, I'm not able to access the linked Discord chat. But from the task list in #2129, it looks like the problem underlying this issue is that, unlike files and directories accessed through SMB shares, Windows does not make security information available on files and directories accessed (on the Windows side) through 9P shares.

Support for 9P shares was added to Windows to implement shares that access files in installed WSL distributions. These are shares named like <code>&bsol;&bsol;wsl$&bsol;<em>distro</em></code> or <code>&bsol;&bsol;wsl.localhost&bsol;<em>distro</em></code>, where *`distro`* is the distribution. Currently 9P is supported on Windows only for such WSL shares (though I don't know if being intended only for this WSL-related use is the reason security information isn't available through them).

This is the case whether the 9P share is accessed through a `\\` path (e.g., `\\share\name`, `\\?\UNC\share\name`) or mapped to a drive letter. It is not specific to mapped drive letters, nor to any particular technique of mapping a share (or other directory) to a drive letter. So the claim that this depends on how the path is mounted is either accurate or inaccurate depending on exactly what is meant by it.

Consider my Windows 10 system, on which the drive letters `Y:` and `Z:` (ignore `X:`) are currently mapped as:

```text
C:\Users\ek> net use
New connections will be remembered.

Status       Local     Remote                    Network

-------------------------------------------------------------------------------
Disconnected X:        \\localhost\C$            Microsoft Windows Network
OK           Y:        \\kip\ek                  Microsoft Windows Network
             Z:        \\wsl$\Ubuntu             Plan 9 Network Provider
The command completed successfully.
```

In this experimental setup, subdirectories `\\kip\ek\temporary` and `\\wsl$\Ubuntu\home\ek\temporary` both exist, and they are both accessible. (These are separate directories on separate systems. They both have same name `temporary` in connection with more systematic testing I've been doing; I hope that's not too confusing.) Each is accessible through the `\\` paths or mounted drive letters.

The SMB ("Microsoft Windows Network") share is accessible:

```text
C:\Users\ek> Get-Item \\kip\ek\temporary

    Directory: \\kip\ek

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----           6/28/2025  2:51 AM                temporary

C:\Users\ek> Get-Item Y:\temporary

    Directory: Y:\

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----           6/28/2025  2:51 AM                temporary
```

And the 9P ("Plan 9 Network Provider") share is accessible:

```text
C:\Users\ek> Get-Item \\wsl$\Ubuntu\home\ek\temporary

    Directory: \\wsl$\Ubuntu\home\ek

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----            7/5/2025  8:28 PM                temporary

C:\Users\ek> Get-Item Z:\home\ek\temporary

    Directory: Z:\home\ek

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----            7/5/2025  8:28 PM                temporary
```

With the SMB share, security information is made available to Windows (this is the case even though `kip` happens to be a GNU/Linux system running a Samba server):

```text
C:\Users\ek> Get-Acl \\kip\ek\temporary

    Directory: \\kip\ek

Path      Owner                                           Access
----      -----                                           ------
temporary O:S-1-5-21-??????????-?????????-??????????-1000 Everyone Allow  ReadAndExecute, Synchronize…

C:\Users\ek> Get-Acl Y:\temporary

    Directory: Y:\

Path      Owner                                           Access
----      -----                                           ------
temporary O:S-1-5-21-??????????-?????????-??????????-1000 Everyone Allow  ReadAndExecute, Synchronize…
```

(I've modified the output shown above by replacing most digits from the non-wellknown SID corresponding to the user `ek` on the machine `kip` with `?` characters. The output is otherwise unmodified.)

In contrast, with the 9P share, security information is not available to Windows:

```text
C:\Users\ek> Get-Acl \\wsl$\Ubuntu\home\ek\temporary
Get-Acl: Method failed with unexpected error code 1.
C:\Users\ek> Get-Acl Z:\home\ek\temporary
Get-Acl: Method failed with unexpected error code 1.
```

To further confirm the cause, note that when the item doesn't exist, `Get-Acl` reports that:

```text
C:\Users\ek> Get-Acl \\wsl$\Ubuntu\home\ek\nonexistent
Get-Acl: Cannot find path '\\wsl$\Ubuntu\home\ek\nonexistent' because it does not exist.
C:\Users\ek> Get-Acl Z:\home\ek\nonexistent
Get-Acl: Cannot find path 'Z:\home\ek\nonexistent' because it does not exist.
```

Thus, it's not that somehow `Get-Item` is able to access the directory but `Get-Acl` is not, but rather than `Get-Acl` accesses the directory but is not able to obtain its security information.

Based on the above, I think the approach in #2129--of treating the error that occurs when security information is unavailable as equivalent to finding that the location should not be trusted, rather than as an error--is reasonable. Once CI is allowed to run in full on #2129, I expect it to work (either already or with minor refinements).

However, also in view of the above, when the feature branch in #2129 is rebased to add a conventional prefix `fix:` to a7d35d4, I recommend that the commit message also be changed. The current message claims that this is fixing the trust check "for mounted paths," which I would consider inaccurate: it's fixing it for paths where Windows cannot access security information. (Since Copilot was used to open that PR, I think Copilot will actually perform the relevant rebase if asked to do so.)

This situation with 9P shares is also responsible for most of what has been reported in #2067. This issue is *almost* a duplicate of #2067, but not quite. That issue claims the trust check performed by `is_path_owned_by_current_user` doesn't work for:

> UNC paths - repos located in WSL, or on network drives, or >255 character long paths

That is accurate for repos located in WSL (provided that is taken to mean repos accessed on the Windows side through 9P shares). It is otherwise mostly inaccurate:

- UNC paths of all styles work fine, network drives in general work fine, and long paths work fine in the `\\?\` (including `\\?\UNC\host\share\`) and `\??\` styles, which are the styles that are supposed to support long paths. (These work regardless of whether greater than usual long path support is enabled in the registry and the executable's application manifest.)
- Whether long paths also work in styles whose semantics do not entail long path support--e.g., paths starting like `C:\` or `\\host\share`--is according to the usual behavior of Windows applications. If such support is enabled in the Windows registry and the executable attempting to access them declares compatibility with such support in its app manifest, then they work. Otherwise, they do not.

However, it seems to me that it nonetheless *is* a bug that `is_path_owned_by_current_user` doesn't work when passed a long path of a style other than those that are supposed to support long paths. The reason is that, while these do not usually work in Windows applications, they *do* usually work in Windows applications implemented in Rust that use the Rust standard library. This is because functions in `std` automatically turn long paths of forms other than `\\?\` and `\??\` into `\\?\` paths before passing them to Windows API functions that could otherwise fail due to the path being unexpectedly long.

Consequently, `is_path_owned_by_current_user` is one of the few--maybe the only--functions in any `gix-*` crate that doesn't support long paths in all styles regardless of app manifest or registry settings. Since this is effectively part of what #2067 reports, I suggest keeping that open even if merging #2129 fixes the bug here. If no one else gets to fixing that long-paths aspect of #2067, I expect that I will eventually, though there are some other improvements in `gix-sec` that I would want to finish working on first.

(#2067 also seems like it is describing that allowlisting paths--or some styles of paths?--in `safe.directory` is not honored. Maybe this falls under #1912, but I'm not sure. I haven't been researching that aspect of it, only the aspects that pertain to `is_path_owned_by_current_user` behavior. I think this will become clear once the information you requested in https://github.com/GitoxideLabs/gitoxide/issues/2067#issuecomment-3015004254 has been provided.)

A separate question is whether it would be acceptable to return `Ok(true)` rather than `Ok(false)` when accessing a 9P share for a WSL distribution that is itself owned by the current user. I am unsure, both whether that would be reasonably safe and whether there is an acceptably simple way to achieve that safely. I would not rush to attempt that.

My research on #2067, including experiments that support most of what I've said above--and that verify each of the cases with various path styles, calling both `std` functions and `is_path_owned_by_current_user`--can be seen in [this gist of currently incomplete notes](https://gist.github.com/EliahKagan/fc8319485af33edbde38db6e7438f2d3).

The claims I haven't, as yet, shown experimental evidence for in that gist are about a long-path-aware configuration, i.e., experiments about the effects of app manifests and registry settings. I've carried out those long-path-aware experiments too, but I've not made a convenient way to verify them, nor written them up. (The experiments shown there were with `evcxr`. The long-path-aware experiments were with `evcxr` modified with an app manifest as in d4f90e3d0a.)

----

Co-authored-by: Eliah Kagan <degeneracypressure@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2025-08-31 19:28:50 +02:00
Sebastian Thiel
8d8dba212f Merge pull request #2145 from GitoxideLabs/dependabot/cargo/cargo-2a6d70b8ef
Bump the cargo group with 3 updates
2025-08-31 08:14:41 +02:00
dependabot[bot]
074ca1ef98 Bump the cargo group with 3 updates
Bumps the cargo group with 3 updates: [tracing-forest](https://github.com/QnnOkabayashi/tracing-forest), [hashbrown](https://github.com/rust-lang/hashbrown) and [sysinfo](https://github.com/GuillaumeGomez/sysinfo).


Updates `tracing-forest` from 0.1.6 to 0.2.0
- [Commits](https://github.com/QnnOkabayashi/tracing-forest/commits)

Updates `hashbrown` from 0.15.5 to 0.16.0
- [Release notes](https://github.com/rust-lang/hashbrown/releases)
- [Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/hashbrown/compare/v0.15.5...v0.16.0)

Updates `sysinfo` from 0.36.1 to 0.37.0
- [Changelog](https://github.com/GuillaumeGomez/sysinfo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/GuillaumeGomez/sysinfo/compare/v0.36.1...v0.37.0)

---
updated-dependencies:
- dependency-name: tracing-forest
  dependency-version: 0.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
- dependency-name: hashbrown
  dependency-version: 0.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
- dependency-name: sysinfo
  dependency-version: 0.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-30 20:42:30 +00:00
Sebastian Thiel
525873fafa Merge pull request #2142 from cruessler/add-branch-list
feat: add first debug version of `gix branch list`
2025-08-30 21:16:40 +02:00
Sebastian Thiel
04650a7786 Fix copy-paste doc comment 2025-08-30 20:57:54 +02:00
Christoph Rüßler
6651548f6e Move --all to 'branch list' 2025-08-30 20:18:56 +02:00
Sebastian Thiel
cd148cf8e6 Merge pull request #2144 from GitoxideLabs/dependabot/cargo/cargo-2dc5bac7e8
Bump tracing-subscriber from 0.3.19 to 0.3.20 in the cargo group
2025-08-30 08:37:46 +02:00
dependabot[bot]
2e254889ff Bump tracing-subscriber from 0.3.19 to 0.3.20 in the cargo group
Bumps the cargo group with 1 update: [tracing-subscriber](https://github.com/tokio-rs/tracing).


Updates `tracing-subscriber` from 0.3.19 to 0.3.20
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.19...tracing-subscriber-0.3.20)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-version: 0.3.20
  dependency-type: direct:production
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-30 06:29:52 +00:00
Sebastian Thiel
eee5199799 Merge pull request #2143 from GitoxideLabs/improvements
various improvements
2025-08-30 08:27:48 +02:00
Sebastian Thiel
888b76301a Fix one failing test on MacOS 2025-08-29 20:47:05 +02:00