-
Notifications
You must be signed in to change notification settings - Fork 626
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
Feature request: show untracked files in the default view #762
Comments
I confirm it's working. Nice to have Staged/Unstaged/Untracked lines! The only thing I'm not sure about is that the "Untracked changes" shows all three lists, and untracked files go last:
Still, it's very helpful even it its current form. Thank you! |
Yes, you are right, especially when there is a lot of staged/unstaged files. It should be possible to move the cursor to the Untracked files section of the status view when it's opened from the Untracked changes line. |
How about removing unrelated sections? |
This is not impossible, however, if you then want to stage some file immediately, you may miss the Staged files section. You’d have to go back to main view and to reopen the status view the regular way to recover it. Not very convenient, don’t you think ? |
There are so many advanced functions that I'm not aware of! I agree that it would be more convenient to see newly staged files in the same view. I'm not sure if all staged files need to be listed. |
Hiding the staged/unstaged files and showing them when needed is not so easy as the cursor must be repositioned correctly. What about the following patch that let them all visible while moving the cursor to the top of the Untracked files ? diff --git a/src/main.c b/src/main.c
index ba869af..9e8fc90 100644
--- a/src/main.c
+++ b/src/main.c
@@ -547,9 +547,10 @@ main_request(struct view *view, enum request request, struct line *line)
if (line->type == LINE_STAT_UNSTAGED
|| line->type == LINE_STAT_STAGED)
open_stage_view(view, NULL, line->type, flags);
- else if (line->type == LINE_STAT_UNTRACKED)
+ else if (line->type == LINE_STAT_UNTRACKED) {
open_status_view(view, flags);
- else
+ status_exists(&status_view, NULL, LINE_STAT_UNTRACKED);
+ } else
open_diff_view(view, flags);
break;
|
I've tested it. It looks a bit strange, but I think it's OK. It highlights the right thing. |
#909 now looks pretty good to me. It shows only untracked files. If you start to stage files with u, it doesn't switch to the full status view but you'll see the Staged changes line appear in the main view and you can press s to switch to the full status view. |
It's a familiar embarrassment for software developers. A pull request is submitted and fails to pass checks because of missing files. The files are on the developer's system, but they are not part of the commit.
Let's make it a thing of the past.
I know,
tig status
would show untracked files. But I don't normally runtig status
. I runtig
without arguments most of the time, and it gives me almost all information I need. The untracked files are an exception, but they should not be.Let's have a special line on top for the untracked files if they are present. That line would be above unstaged and staged changes, since the untracked files are further from becoming a commit than the changes that git knows about.
If the untracked files are shown by default, it would also encourage the developers to keep
.gitignore
files up-to-date.The text was updated successfully, but these errors were encountered: