Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent "hg status" from showing everything under untracked directories

Tags:

mercurial

I find the output of hg status too verbose for untracked directories. Suppose I have an empty repository that's managed by both git and hg. So there would be two directories, .git and .hg.

The output of git status is:

# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   .hg/

The output of hg status is:

? .git/HEAD
? .git/config
? .git/description
? .git/hooks/applypatch-msg.sample
? .git/hooks/commit-msg.sample
? .git/hooks/post-commit.sample
? .git/hooks/post-receive.sample
? .git/hooks/post-update.sample
? .git/hooks/pre-applypatch.sample
? .git/hooks/pre-commit.sample
? .git/hooks/pre-rebase.sample
? .git/hooks/prepare-commit-msg.sample
? .git/hooks/update.sample
? .git/info/exclude

Is there a way to reduce its output to something like the following line?

? .git/
like image 819
Wei Hu Avatar asked Mar 26 '10 04:03

Wei Hu


People also ask

How do I remove untracked files from Mercurial?

Add the Mercurial Extension called purge. It is distributed by Mercurial. It is not enabled by default, maybe to avoid accidentally removing files that you forgot to add.

Does git status show untracked files?

Git also doesn't see any untracked files, or they would be listed here. Finally, the command tells you which branch you're on and informs you that it has not diverged from the same branch on the server. For now, that branch is always master , which is the default; you won't worry about it here.

What does hg purge do?

This extension purges all files and directories not being tracked by Mercurial in the current repository. It'll remove unknown files and empty directories by default. With the --all option, it will also remove ignored files. It keeps added files and (unmodified or modified) tracked files.


1 Answers

This works for me :

hg status -q

Option -q/--quiet hides untracked (unknown and ignored) files unless explicitly requested with -u/--unknown or -i/--ignored.

like image 149
wong2 Avatar answered Sep 21 '22 21:09

wong2