path: root/wt-status.h
AgeCommit message (Collapse)Author
2010-06-30Merge branch 'jl/status-ignore-submodules'Junio C Hamano
* jl/status-ignore-submodules: Add the option "--ignore-submodules" to "git status" git submodule: ignore dirty submodules for summary and status Conflicts: builtin/commit.c t/ wt-status.c wt-status.h
2010-06-25Add the option "--ignore-submodules" to "git status"Jens Lehmann
In some use cases it is not desirable that "git status" considers submodules that only contain untracked content as dirty. This may happen e.g. when the submodule is not under the developers control and not all build generated files have been added to .gitignore by the upstream developers. Using the "untracked" parameter for the "--ignore-submodules" option disables checking for untracked content and lets git diff report them as changed only when they have new commits or modified content. Sometimes it is not wanted to have submodules show up as changed when they just contain changes to their work tree (this was the behavior before 1.7.0). An example for that are scripts which just want to check for submodule commits while ignoring any changes to the work tree. Also users having large submodules known not to change might want to use this option, as the - sometimes substantial - time it takes to scan the submodule work tree(s) is saved when using the "dirty" parameter. And if you want to ignore any changes to submodules, you can now do that by using this option without parameters or with "all" (when the config option status.submodulesummary is set, using "all" will also suppress the output of the submodule summary). A new function handle_ignore_submodules_arg() is introduced to parse this option new to "git status" in a single location, as "git diff" already knew it. Signed-off-by: Jens Lehmann <> Signed-off-by: Junio C Hamano <>
2010-06-21Merge branch 'gv/portable'Junio C Hamano
* gv/portable: test-lib: use DIFF definition from GIT-BUILD-OPTIONS build: propagate $DIFF to scripts Makefile: Tru64 portability fix Makefile: HP-UX 10.20 portability fixes Makefile: HPUX11 portability fixes Makefile: SunOS 5.6 portability fix inline declaration does not work on AIX Allow disabling "inline" Some platforms lack socklen_t type Make NO_{INET_NTOP,INET_PTON} configured independently Makefile: some platforms do not have hstrerror anywhere git-compat-util.h: some platforms with mmap() lack MAP_FAILED definition test_cmp: do not use "diff -u" on platforms that lack one fixup: do not unconditionally disable "diff -u" tests: use "test_cmp", not "diff", when verifying the result Do not use "diff" found on PATH while building and installing enums: omit trailing comma for portability Makefile: -lpthread may still be necessary when libc has only pthread stubs Rewrite dynamic structure initializations to runtime assignment Makefile: pass CPPFLAGS through to fllow customization Conflicts: Makefile wt-status.h
2010-06-03Show branch information in short output of git statusDaniel Knittl-Frank
This patch adds a first line in the output of `git status -s` when given the option `-b` or `--branch`, showing which branch the user is currently on, and in case of tracking branches the number of commits on each branch. Signed-off-by: Daniel Knittl-Frank <> Signed-off-by: Junio C Hamano <>
2010-05-31enums: omit trailing comma for portabilityGary V. Vaughan
Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX 5.1 fails to compile git. enum style is inconsistent already, with some enums declared on one line, some over 3 lines with the enum values all on the middle line, sometimes with 1 enum value per line... and independently of that the trailing comma is sometimes present and other times absent, often mixing with/without trailing comma styles in a single file, and sometimes in consecutive enum declarations. Clearly, omitting the comma is the more portable style, and this patch changes all enum declarations to use the portable omitted dangling comma style consistently. Signed-off-by: Gary V. Vaughan <> Signed-off-by: Junio C Hamano <>
2010-04-10wt-status: collect ignored filesJunio C Hamano
Signed-off-by: Junio C Hamano <>
2010-04-10wt-status: remove unused workdir_untracked memberJunio C Hamano
Signed-off-by: Junio C Hamano <>
2010-03-08git status: Show detailed dirty status of submodules in long formatJens Lehmann
Since 1.7.0 there are three reasons a submodule is considered modified against the work tree: It contains new commits, modified content or untracked content. Lets show all reasons in the long format of git status, so the user can better asses the nature of the modification. This change does not affect the short and porcelain formats. Two new members are added to "struct wt_status_change_data" to store the information gathered by run_diff_files(). wt-status.c uses the new flag DIFF_OPT_DIRTY_SUBMODULES to tell diff-lib.c it wants to get detailed dirty information about submodules. A hint line for submodules is printed in the dirty header when dirty submodules are present. Signed-off-by: Jens Lehmann <> Signed-off-by: Junio C Hamano <>
2009-12-12status/commit: do not suggest "reset HEAD <path>" while mergingJunio C Hamano
Suggesting "'reset HEAD <path>' to unstage" is dead wrong if we are about to record a merge commit. For either an unmerged path (i.e. with unresolved conflicts), or an updated path, it would result in discarding what the other branch did. Note that we do not do anything special in a case where we are amending a merge. The user is making an evil merge starting from an already committed merge, and running "reset HEAD <path>" is the right way to get rid of the local edit that has been added to the index. Once "reset --unresolve <path>" becomes available, we might want to suggest it for a merged path that has unresolve information, but until then, just remove the incorrect advice. We might also want to suggest "checkout --conflict <path>" to revert the file in the work tree to the state of failed automerge for an unmerged path, but we never did that, and this commit does not change that. Signed-off-by: Junio C Hamano <>
2009-12-07status: disable color for porcelain formatJeff King
The porcelain format is identical to the shortstatus format, except that it should not respect any user configuration, including color. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2009-12-05builtin-commit: refactor short-status code into wt-status.cMichael J Gruber
Currently, builtin-commit.c contains most code producing the short-status output, whereas wt-status.c contains most of the code for the long format. Refactor so that most of the long and short format producing code resides in wt-status.c and is named analogously. Signed-off-by: Michael J Gruber <> Signed-off-by: Junio C Hamano <>
2009-08-22git stat: the beginning of "status that is not a dry-run of commit"Junio C Hamano
Tentatively add "git stat" as a new command. This is not "preview of commit with the same arguments"; the path parameters are not paths to be added to the pristine index (aka "--only" option), but are taken as pathspecs to limit the output. Later in 1.7.0 release, it will take over "git status". Signed-off-by: Junio C Hamano <>
2009-08-10wt-status: collect untracked files in a separate "collect" phaseJunio C Hamano
In a way similar to updated and locally modified files are collected. Signed-off-by: Junio C Hamano <>
2009-08-10Make git_status_config() file scope static to builtin-commit.cJunio C Hamano
Signed-off-by: Junio C Hamano <>
2009-08-10wt-status: move wt_status_colors[] into wt_status structureJunio C Hamano
The benefit of this one alone is somewhat iffy, but for completeness this moves the wt_status_colors[] color palette to the wt_status structure to complete the libification started by the previous commit. Signed-off-by: Junio C Hamano <>
2009-08-10wt-status: move many global settings to wt_status structureJunio C Hamano
Turn four global variables (wt_status_use_color, show_tracked_files, wt_status_relative_paths, and wt_status_submodule_summary) into fields of wt_status structure. They can also lose "wt_status_" prefix. Get rid of "untracked" field that was used only to keep track of otherwise available information redundantly. Signed-off-by: Junio C Hamano <>
2009-08-07status: show worktree status of conflicted paths separatelyJunio C Hamano
When a path is unmerged in the index, we used to always say "unmerged" in the "Changed but not updated" section, even when the path was deleted in the work tree. Remove unmerged entries from the "Updated" section, and create a new section "Unmerged paths". Describe how the different stages conflict in more detail in this new section. Note that with the current 3-way merge policy (with or without recursive), certain combinations of index stages should never happen. For example, having only stage #2 means that a path that did not exist in the common ancestor was added by us while the other branch did not do anything to it, which would have autoresolved to take our addition. The code nevertheless prepares for the possibility that future merge policies may leave a path in such a state. Signed-off-by: Junio C Hamano <>
2009-08-06wt-status.c: rework the way changes to the index and work tree are summarizedJunio C Hamano
Introduce a new infrastructure to find and summarize changes in a single string list, and rewrite wt_status_print_{updated,changed} functions using it. The goal of this change is to give more information on conflicted paths in the status output. Signed-off-by: Junio C Hamano <>
2008-06-09Add argument 'no' commit/status option -u|--untracked-filesMarius Storm-Olsen
This new argument teaches Git to not look for any untracked files, saving cycles on slow file systems, or large repos. Signed-off-by: Marius Storm-Olsen <>
2008-06-09Add an optional <mode> argument to commit/status -u|--untracked-files optionMarius Storm-Olsen
This lets you specify how you want untracked files to be listed. The possible options are: normal - Show untracked files and directories all - Show all untracked files The 'all' mode is used, if the mode is not specified. Signed-off-by: Marius Storm-Olsen <>
2008-05-25Merge branch 'js/config-cb'v1.5.6-rc0Junio C Hamano
* js/config-cb: Provide git_config with a callback-data parameter Conflicts: builtin-add.c builtin-cat-file.c
2008-05-23Updated status to show 'Not currently on any branch' in redChris Parsons
This provides additional warning to users when attempting to commit to a detached HEAD. It is configurable in color.status.nobranch. Signed-off-by: Chris Parsons <> Acked-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2008-05-14Provide git_config with a callback-data parameterJohannes Schindelin
git_config() only had a function parameter, but no callback data parameter. This assumes that all callback functions only modify global variables. With this patch, every callback gets a void * parameter, and it is hoped that this will help the libification effort. Signed-off-by: Johannes Schindelin <> Signed-off-by: Junio C Hamano <>
2008-05-11wt-status.h: declare global variables as externJohannes Sixt
There are linkers out there that complain if a global non-static variable is defined multiple times. Signed-off-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
2007-12-13git-commit: squelch needless message during an empty mergeJunio C Hamano
When recording a merge that conflicted and ends up in no changes after manual resolution, commit callchain looked like this: cmd_commit() -> prepare_log_message() -> run_status() -> wt_status_print() This invocation of run_status() is asked to find out if there is a committable change, but it unconditionally gave instructions such as "use git-add" at the same time. When in merge, we do allow an empty change to be recorded, so after showing this message the code still went ahead and made a commit. This introduces "nowarn" parameter to run_status() to avoid these useless messages. If we are not allowed to create an empty commit, we already call run_status() again in the original codepath, and the message will be shown from that call anyway. Signed-off-by: Junio C Hamano <>
2007-12-08add status.relativePaths config variableJeff King
The output of git-status was recently changed to output relative paths. Setting this variable to false restores the old behavior for any old-timers that prefer it. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2007-11-23builtin-commit: do not color status output shown in the message templateJunio C Hamano
Noticed by Ping Yin on the list. Signed-off-by: Junio C Hamano <>
2007-11-23git status: show relative paths when run in a subdirectoryJohannes Schindelin
To show the relative paths, the function formerly called quote_crlf() (now called quote_path()) takes the prefix as an additional argument. While at it, the static buffers were replaced by strbufs. Signed-off-by: Johannes Schindelin <> Signed-off-by: Junio C Hamano <>
2007-09-19Enable wt-status to run against non-standard index file.Kristian Høgsberg
We still default to get_index_file(), but this can be overridden by setting wt_status.index_file after calling wt_status_prepare(). Signed-off-by: Kristian Høgsberg <> Signed-off-by: Junio C Hamano <>
2007-09-19Enable wt-status output to a given FILE pointer.Kristian Høgsberg
Still defaults to stdout, but you can now override wt_status.fp after calling wt_status_prepare(). Signed-off-by: Kristian Høgsberg <> Signed-off-by: Junio C Hamano <>
2007-01-10Provide better feedback for the untracked only case in status outputJürgen Rühle
Since 98bf8a47c296f51ea9722fef4bb81dbfb70cd4bb status would claim that git-commit could be useful even if there are no changes except untracked files. Since wt-status is already computing all the information needed go the whole way and actually track the (non-)emptiness of all three sections separately, unify the code, and provide useful messages for each individual case. Thanks to Junio and Michael Loeffler for suggestions. Signed-off-by: Jürgen Rühle <>
2007-01-03Improve "nothing to commit" part of status outputJürgen Rühle
Previously git-status in a clean working directory would advice the user to use git add. This isn't very helpful when there is nothing to add in the working directory, therefore note a clean working directory while displaying the other sections and print the appropriate message for each case. Signed-off-by: Jürgen Rühle <> Signed-off-by: Junio C Hamano <>
2006-09-13Teach runstatus about --untrackedJohannes Schindelin
Actually, teach runstatus what to do if it is not passed; it should not list the contents of completely untracked directories, but only the name of that directory (plus a trailing '/'). [jc: with comments by Jeff King to match hide-empty-directories behaviour of the original.] Signed-off-by: Johannes Schindelin <> Signed-off-by: Junio C Hamano <> convert run_status to a C builtinJeff King
This creates a new git-runstatus which should do roughly the same thing as the run_status function from Except for color support, the main focus has been to keep the output identical, so that it can be verified as correct and then used as a C platform for other improvements to the status printing code. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>