Skip to content

rename-tracking for gix-status #1306

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 26 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
259b38e
fix usage of tracing span (which now is just a message)
Byron Mar 4, 2024
57cf83b
feat!: `diff::resource_cache()` now takes the attribute stack directly.
Byron Feb 27, 2024
e20b6b1
feat!: Provide more source information when emitting rewrites.
Byron Feb 27, 2024
80a6cb8
feat: add index-to-worktree status with rename tracking
Byron Feb 15, 2024
0330ad7
feat: add `Status` iterator.
Byron Oct 5, 2023
2d40bdf
adapt to changes in `gix`
Byron Mar 4, 2024
434f543
fix: make it possible to use a submodule root for a full walk.
Byron Mar 7, 2024
a29fa00
feat: Add `Submodule::status()` method.
Byron Mar 6, 2024
4a4989d
Add submodule support for status iterator
Byron Mar 7, 2024
c20ad28
feat: add `Repository::is_dirty()`
Byron Mar 8, 2024
c7ddd30
feat: describing commits can now be done with conditional dirty-suffi…
Byron Mar 8, 2024
17bef30
provide a non-parallel version of the status iteration
Byron Mar 9, 2024
58231b4
feat: add `gix commit describe --dirty-suffix`
Byron Mar 9, 2024
afd20ca
feat: `gix submodules list --dirty-suffix` for dirty-information
Byron Mar 9, 2024
98b3680
feat: add `gix is-clean|is-changed`
Byron Mar 9, 2024
f1ba7bd
Allow configuration of interrupts in status iter
Byron Mar 10, 2024
61c002b
feat: `gix status` with submodule and rewrite support.
Byron Mar 9, 2024
f8ce3d0
fix lints for nightly, and clippy
Byron Mar 10, 2024
22abf60
add `status.showUntrackedFiles` to config-tree and use it in `status()`
Byron Mar 11, 2024
66e87cd
feat: add `gix status --index-worktree-renames`
Byron Mar 12, 2024
84c74ff
feat: add `gix status --ignored` support
Byron Mar 12, 2024
23bea36
add `gix status --format` to communicate the current format is very s…
Byron Mar 13, 2024
917634f
Keep lower-bound of `thiserror` low in `gix-dir`
Byron Mar 13, 2024
2dc373f
feat: provide `Entry::worktree_summary()`
Byron Mar 14, 2024
da45d92
make `summary` available for `Item`.
Byron Mar 14, 2024
3753592
assure submodule status doesn't operate if there is no worktree checkout
Byron Mar 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 17 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Setup dependencies
run:
sudo apt-get install tree
- uses: extractions/setup-just@v1
- name: test
env:
CI: true
GITOXIDE_TEST_IGNORE_ARCHIVES: 1
run: just ci-test
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Setup dependencies
run:
sudo apt-get install tree
- uses: extractions/setup-just@v1
- name: test
env:
CI: true
GITOXIDE_TEST_IGNORE_ARCHIVES: 1
run: just ci-test

test-fast:
strategy:
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
components: clippy,rustfmt
- uses: extractions/setup-just@v1
- name: Run cargo clippy
run: just clippy -D warnings
run: just clippy -D warnings -A unknown-lints
- name: Run cargo doc
run: just doc
- name: Run cargo fmt
Expand All @@ -189,10 +189,10 @@ jobs:
continue-on-error: ${{ matrix.checks == 'advisories' }}

steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
wasm:
name: WebAssembly
runs-on: ubuntu-latest
Expand Down
15 changes: 13 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions crate-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,12 +552,12 @@ Make it the best-performing implementation and the most convenient one.

### gix-status
* [x] differences between index and worktree to turn index into worktree
- [ ] rename tracking
- [x] rename tracking
- [x] untracked files
- [ ] support for fs-monitor for modification checks
* [ ] differences between index and index to learn what changed
- [ ] rename tracking
* [ ] untracked files
* [ ] fast answer to 'is it dirty'.
*

### gix-worktree-state
* handle the working **tree/checkout**
- [x] checkout an index of files, executables and symlinks just as fast as git
Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/src/repository/attributes/query.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use gix::repository::IndexPersistedOrInMemory;
use gix::worktree::IndexPersistedOrInMemory;

use crate::OutputFormat;

Expand Down
4 changes: 3 additions & 1 deletion gitoxide-core/src/repository/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub fn describe(
statistics,
max_candidates,
long_format,
dirty_suffix,
}: describe::Options,
) -> Result<()> {
repo.object_cache_size_if_unset(4 * 1024 * 1024);
Expand Down Expand Up @@ -80,7 +81,7 @@ pub fn describe(
writeln!(err, "traversed {} commits", resolution.outcome.commits_seen)?;
}

let mut describe_id = resolution.format()?;
let mut describe_id = resolution.format_with_dirty_suffix(dirty_suffix)?;
describe_id.long(long_format);

writeln!(out, "{describe_id}")?;
Expand All @@ -97,5 +98,6 @@ pub mod describe {
pub long_format: bool,
pub statistics: bool,
pub max_candidates: usize,
pub dirty_suffix: Option<String>,
}
}
2 changes: 0 additions & 2 deletions gitoxide-core/src/repository/credential.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::convert::TryInto;

#[derive(Debug, thiserror::Error)]
enum Error {
#[error(transparent)]
Expand Down
32 changes: 32 additions & 0 deletions gitoxide-core/src/repository/dirty.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
use crate::OutputFormat;
use anyhow::bail;

pub enum Mode {
IsClean,
IsDirty,
}

pub fn check(
repo: gix::Repository,
mode: Mode,
out: &mut dyn std::io::Write,
format: OutputFormat,
) -> anyhow::Result<()> {
if format != OutputFormat::Human {
bail!("JSON output isn't implemented yet");
}
let is_dirty = repo.is_dirty()?;
let res = match (is_dirty, mode) {
(false, Mode::IsClean) => Ok("The repository is clean"),
(true, Mode::IsClean) => Err("The repository has changes"),
(false, Mode::IsDirty) => Err("The repository is clean"),
(true, Mode::IsDirty) => Ok("The repository has changes"),
};

let suffix = "(not counting untracked files)";
match res {
Ok(msg) => writeln!(out, "{msg} {suffix}")?,
Err(msg) => bail!("{msg} {suffix}"),
}
Ok(())
}
2 changes: 1 addition & 1 deletion gitoxide-core/src/repository/index/entries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub(crate) mod function {

use gix::{
bstr::{BStr, BString},
repository::IndexPersistedOrInMemory,
worktree::IndexPersistedOrInMemory,
Repository,
};

Expand Down
1 change: 1 addition & 0 deletions gitoxide-core/src/repository/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub use credential::function as credential;
pub mod attributes;
#[cfg(feature = "clean")]
pub mod clean;
pub mod dirty;
#[cfg(feature = "clean")]
pub use clean::function::clean;
#[cfg(feature = "blocking-client")]
Expand Down
Loading