You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] Track unstaged local Git changes by default #268
As I understand, unstaged changes are included in the diff patch. There is a problem with untracked files. But since they weren't seen by the git — diff for them is simply all “add“ lines with a header.
@Egor-S As far as I know unstaged and untracked is the same thing. I meant untracked.
Do you mean we could simply include untracked files ourselves into repo_diff?
I just tried: to create a completely new file, to edit an existing file without git add, and to edit an existing file but with git add. There is the output:
egors:~/dstack/hello-world-local/.dstack/workflows 🚀 git status
On branch dev
Your branch is ahead of 'origin/dev' by 1 commit.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: ssh.yaml
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: hello.yaml
Untracked files:
(use "git add <file>..." to include in what will be committed)
new-untracked.yaml
Both ssh.yaml and hello.yaml appear in git.Repo().git.diff(remote_hash)
Yes, I think it would be pretty easy to handcraft diff patches for new files. We should replicate the output of git diff --no-index /dev/null {file}. Possible template:
Activity
Egor-S commentedon May 9, 2023
As I understand, unstaged changes are included in the diff patch. There is a problem with untracked files. But since they weren't seen by the git — diff for them is simply all “add“ lines with a header.
git diffformat reference: https://git-scm.com/docs/diff-formatpeterschmidt85 commentedon May 9, 2023
@Egor-S As far as I know unstaged and untracked is the same thing. I meant untracked.
Do you mean we could simply include untracked files ourselves into
repo_diff?Egor-S commentedon May 10, 2023
I just tried: to create a completely new file, to edit an existing file without
git add, and to edit an existing file but withgit add. There is the output:Both
ssh.yamlandhello.yamlappear ingit.Repo().git.diff(remote_hash)Yes, I think it would be pretty easy to handcraft diff patches for new files. We should replicate the output of
git diff --no-index /dev/null {file}. Possible template:Egor-S commentedon May 10, 2023
Implemented in #388