Skip to content

feat: add untrack feature#146

Merged
istudyatuni merged 18 commits intoCretezy:mainfrom
Spiegie:feat-add-untrack-feature
Jul 9, 2025
Merged

feat: add untrack feature#146
istudyatuni merged 18 commits intoCretezy:mainfrom
Spiegie:feat-add-untrack-feature

Conversation

@Spiegie
Copy link
Contributor

@Spiegie Spiegie commented Jun 27, 2025

closes #145

I want to include a option to retrack files but I'm not shure if I should do it in this PR.
also the code is not very clean yet.

@Spiegie
Copy link
Contributor Author

Spiegie commented Jun 27, 2025

I still need to impement logic to see, if the file is already ignored by a .gitignore. right now, the user decides if the file is added to .git/info/exclude

@Spiegie
Copy link
Contributor Author

Spiegie commented Jun 28, 2025

git clean -ndX can help here but git clean is not implemented as subcommand in jj git

@Spiegie
Copy link
Contributor Author

Spiegie commented Jun 29, 2025

I think depending on git is not a good idea. There is no way to query all ignored files with jj (yet). maybe we should just wait for jj to implement the improved untrack handling or the list ignored files feature maybe as subcommand. Till then, I mark my PR as complete and will come back, when things developed.

@Spiegie Spiegie changed the title draft: feat: add untrack feature feat: add untrack feature Jun 29, 2025
@Spiegie
Copy link
Contributor Author

Spiegie commented Jun 29, 2025

@istudyatuni would you agree with this PR?

I will try to add tests.

@Spiegie
Copy link
Contributor Author

Spiegie commented Jun 29, 2025

I think the untrack and ignore part is to much for me to chew. I remove it from this PR and try to come back when I'm more experienced.

@Spiegie
Copy link
Contributor Author

Spiegie commented Jun 29, 2025

For now, I reworked the logic like this:

First get the current list of files. Now untrack the selected file. Then get the current list of files again. If no change is detected, the file is not ignored. This triggers a message-popup prompting the user to ignore the file. If a change is detected (before and after are not the same) I assume everything worked fine and no popup is triggered.

The auto-exclude-logic is gone, because I needed to rely on a Git-Repository, which would be fine if I tested for it. But I don't think, I can pull this off.

Unfortunately, now you can untrack a deleted file. This triggers no change in files, resulting in an unwanted popup. I need to figure out, how to get the state of the current selected file.

@Spiegie Spiegie requested a review from istudyatuni July 4, 2025 05:30
@Spiegie
Copy link
Contributor Author

Spiegie commented Jul 7, 2025

Thank you very much :)

Spiegie and others added 6 commits July 7, 2025 16:18
suggested by  istudyatuni

Co-authored-by: Ilia <43654815+istudyatuni@users.noreply.github.com>
suggested by  istudyatuni

Co-authored-by: Ilia <43654815+istudyatuni@users.noreply.github.com>
suggested by istudyatuni

Co-authored-by: Ilia <43654815+istudyatuni@users.noreply.github.com>
suggested by istudyatuni

Co-authored-by: Ilia <43654815+istudyatuni@users.noreply.github.com>
@Spiegie
Copy link
Contributor Author

Spiegie commented Jul 7, 2025

i needed to bump the edition to 2024 becaue of rust-lang/rust#53667

@Spiegie Spiegie requested a review from istudyatuni July 7, 2025 14:32
@Spiegie
Copy link
Contributor Author

Spiegie commented Jul 7, 2025

sorry for not providing tests... I simply don't have the time right now. And thank you again for the reviews and suggestions.

@istudyatuni
Copy link
Collaborator

istudyatuni commented Jul 7, 2025

Edition will be also bumped in #149 , and since it requires formatting a lot of files, let's wait a bit for this

@Spiegie
Copy link
Contributor Author

Spiegie commented Jul 9, 2025

I resolved the conflicts and moved to a branch other than main.

@istudyatuni istudyatuni merged commit 85c8e21 into Cretezy:main Jul 9, 2025
10 checks passed
@istudyatuni
Copy link
Collaborator

Thanks!

@Spiegie
Copy link
Contributor Author

Spiegie commented Jul 10, 2025

i needed to implement the special handling for deleted files, because untracking a deleted file does not trigger a change in the view. if no change is triggered, the message to ignore the file first gets displayed.

@istudyatuni
Copy link
Collaborator

I refactored code and it just checks the exit code of jj untrack now, is it an error or not

@Spiegie Spiegie deleted the feat-add-untrack-feature branch July 10, 2025 18:10
@Spiegie
Copy link
Contributor Author

Spiegie commented Jul 10, 2025

oh ok now I understand sorry and thank you for your patience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

untrack files

2 participants