Bug 4119 - don't list the content of untracked directories in status command
Summary: don't list the content of untracked directories in status command
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: PC Linux
: normal feature
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-03 02:59 UTC by Denis Laxalde
Modified: 2017-10-16 00:00 UTC (History)
5 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Laxalde 2013-12-03 02:59 UTC
Hi,

The status command lists all untracked files by default. This can be quite expensive (especially when working remotely) when one has, e.g., a build directory full of temporary files. While one can always add these to .hgignore or use -q option, I would like to suggest that the status command only lists top-level directories if there's only untracked files inside, instead of listing there full content.

Thanks for considering,
Denis
Comment 1 Bryan O'Sullivan 2013-12-03 13:55 UTC
This has been the behaviour for 8 years, and to change it now would cause a lot of breakage in scripts and the like.
Comment 2 Denis Laxalde 2013-12-05 02:57 UTC
(In reply to comment #1)

Ok, I understand that changing the default might not acceptable.

How about an option (e.g. `hg status --limit`)? Would this be acceptable?
Comment 3 Matt Mackall 2013-12-05 15:42 UTC
You might want the pager extension.
Comment 4 Martin Geisler 2013-12-05 17:46 UTC
The feature Denis is talking about is more than just the pager extension. I've seen it in Git, where you get output like this:

  $ mkdir foo
  $ touch foo/{a,b,c}
  $ git status
  # On branch master
  #
  # Initial commit
  #
  # Untracked files:
  #   (use "git add <file>..." to include in what will be committed)
  #
  #       foo/
  nothing added to commit but untracked files present (use "git add" to track)

I quite like the output -- normally much more convenient than seeing a full directory tree of untracked files.

The feature might not belong in core, but an extension could change the status output to this format (while respecting HGPLAIN).
Comment 5 HG Bot 2017-10-04 18:01 UTC
Fixed by https://mercurial-scm.org/repo/hg/rev/4cd4344a53c4
Pulkit Goyal <7895pulkit@gmail.com>
status: add a flag to terse the output (issue4119)

This adds an experimental flag -t/--terse which will terse the output. The terse flag
will respect other flags which filters the output. The flag takes a string
whose value can be a subsequence of "marduic" (the order does not matter here.)

Ignored files are not considered while tersing unless -i flag is passed or 'i'
is there is the terse flag value.

The flag is experimental for testing as there may be cases which will produce
strange results with the flag. We can set the terse on by default by simply
passing 'u' to the cmdutil.tersestatus().

This patch also adds a test file with tests covering the new feature.

(please test the fix)
Comment 6 Bugzilla 2017-10-16 00:00 UTC
Bug was set to TESTING for 11 days, resolving