Commit Graph

19289 Commits

Author SHA1 Message Date
Michael J Gruber
68cfc6f551 t7508-status: test all modes with color
Move a useful script function to decode colored output to
text form from t4034 and use it in this test as well.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-08 21:52:47 -08:00
Michael J Gruber
c521bb7114 t7508-status: status --porcelain ignores relative paths setting
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-08 12:54:57 -08:00
Jeff King
8661768fc9 status: reduce duplicated setup code
We have three output formats: short, porcelain, and long.
The short and long formats respect user-config, and the
porcelain one does not. This led to us repeating
config-related setup code for the short and long formats.

Since the last commit, color config is explicitly cleared
when showing the porcelain format. Let's do the same with
relative-path configuration, which enables us to hoist the
duplicated code from the switch statement in cmd_status.

As a bonus, this fixes "commit --dry-run --porcelain", which
was unconditionally setting up that configuration, anyway.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-07 00:41:14 -08:00
Jeff King
4a7cc2fdf3 status: disable color for porcelain format
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-07 00:40:22 -08:00
Michael J Gruber
3fe2a894e9 status -s: obey color.status
Make the short version of status obey the color.status boolean. We color
the status letters only, because they carry the state information and are
potentially colored differently, such as for a file with staged changes
as well as changes in the worktree against the index.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-05 09:27:56 -08:00
Michael J Gruber
84dbe7b867 builtin-commit: refactor short-status code into wt-status.c
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 <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-12-05 09:27:23 -08:00
Michael J Gruber
14ed05ddd6 t7508-status.sh: Add tests for status -s
The new short status has been completely untested so far. Introduce
tests by duplicating all tests which are present for the long format.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-27 15:14:59 -08:00
Michael J Gruber
482a6c1061 status -s: respect the status.relativePaths option
Otherwise, 'status' and 'status -s' in a subdir would produce different
names.  This change is all the more important because status.relativePaths
is on by default.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-26 19:15:57 -08:00
Jeff King
46b77a6b48 docs: note that status configuration affects only long format
The short format does not respect any of the usual status.*
configuration.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-05 23:16:38 -07:00
Jeff King
7c9f7038e9 commit: support alternate status formats
The status command recently grew "short" and "porcelain"
options for alternate output formats. Since status is no
longer "commit --dry-run", these formats are inaccessible to
people who do want to see a dry-run in a parseable form.

This patch makes those formats available to "git commit",
implying the "dry-run" option when they are used.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-05 23:16:32 -07:00
Jeff King
6f15787181 status: add --porcelain output format
The "short" format was added to "git status" recently to
provide a less verbose way of looking at the same
information. This has two practical uses:

  1. Users who want a more dense display of the information.

  2. Scripts which want to parse the information and need a
     stable, easy-to-parse interface.

For now, the "--short" format covers both of those uses.
However, as time goes on, users of (1) may want additional
format tweaks, or for "git status" to change its behavior
based on configuration variables. Those wishes will be at
odds with (2), which wants to stability for scripts.

This patch introduces a separate --porcelain option early to
avoid problems later on.  Right now the --short and
--porcelain outputs are identical. However, as time goes on,
we will have the freedom to customize --short for human
consumption while keeping --porcelain stable.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-05 23:16:31 -07:00
Jeff King
dd2be243d6 status: refactor format option parsing
This makes it possible to have more than two formats.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-05 23:16:27 -07:00
Jeff King
01d8ba187d status: refactor short-mode printing to its own function
We want to be able to call it from multiple places.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-05 23:16:25 -07:00
Jeff King
9b4fe22990 status: typo fix in usage
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-05 23:15:51 -07:00
Junio C Hamano
9e4b7ab652 git status: not "commit --dry-run" anymore
This removes tentative "git stat" and make it take over "git status".

There are some tests that expect "git status" to exit with non-zero status
when there is something staged.  Some tests expect "git status path..." to
show the status for a partial commit.

For these, replace "git status" with "git commit --dry-run".  For the
ones that do not attempt a dry-run of a partial commit that check the
output from the command, check the output from "git status" as well, as
they should be identical.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-22 12:18:00 -07:00
Junio C Hamano
173e6c8852 git stat -s: short status output
Give -s(hort) option to "git stat" that shows the status of paths in a
more concise way.

    XY PATH1 -> PATH2

format to be more machine readable than output from "git status", which is
about previewing of "git commit" with the same arguments.

PATH1 is the path in the HEAD, and " -> PATH2" part is shown only when
PATH1 corresponds to a different path in the index/worktree.

For unmerged entries, X shows the status of stage #2 (i.e. ours) and Y
shows the status of stage #3 (i.e. theirs).  For entries that do not have
conflicts, X shows the status of the index, and Y shows the status of the
work tree.  For untracked paths, XY are "??".

    X          Y     Meaning
    -------------------------------------------------
              [MD]   not updated
    M        [ MD]   updated in index
    A        [ MD]   added to index
    D        [ MD]   deleted from index
    R        [ MD]   renamed in index
    C        [ MD]   copied in index
    [MARC]           index and work tree matches
    [ MARC]     M    work tree changed since index
    [ MARC]     D    deleted in work tree

    D           D    unmerged, both deleted
    A           U    unmerged, added by us
    U           D    unmerged, deleted by them
    U           A    unmerged, added by them
    D           U    unmerged, deleted by us
    A           A    unmerged, both added
    U           U    unmerged, both modified

    ?           ?    untracked

When given -z option, the records are terminated by NUL characters for
better machine readability.  Because the traditional long format is
designed for human consumption, NUL termination does not make sense.
For this reason, -z option implies -s (short output).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-22 12:18:00 -07:00
Junio C Hamano
76e2f7ce32 git stat: the beginning of "status that is not a dry-run of commit"
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 <gitster@pobox.com>
2009-08-22 12:15:57 -07:00
Junio C Hamano
3fa509dfbd git commit --dry-run -v: show diff in color when asked
The earlier implementation of --dry-run didn't duplicate the use of color
"git status -v" set up for diff output.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-15 02:33:21 -07:00
Junio C Hamano
60c2993c92 Documentation/git-commit.txt: describe --dry-run
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-15 01:58:37 -07:00
Junio C Hamano
7637868362 wt-status: collect untracked files in a separate "collect" phase
In a way similar to updated and locally modified files are collected.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10 12:56:43 -07:00
Junio C Hamano
f766b36783 Make git_status_config() file scope static to builtin-commit.c
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10 12:56:36 -07:00
Junio C Hamano
23900a9646 wt-status: move wt_status_colors[] into wt_status structure
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 <gitster@pobox.com>
2009-08-10 12:54:07 -07:00
Junio C Hamano
d249b09889 wt-status: move many global settings to wt_status structure
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 <gitster@pobox.com>
2009-08-10 12:50:30 -07:00
Junio C Hamano
3a5d13a3c3 commit: --dry-run
This teaches --dry-run option to "git commit".

It is the same as "git status", but in the longer term we would want to
change the semantics of "git status" not to be the preview of commit, and
this is the first step for doing so.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-07 23:03:36 -07:00
Junio C Hamano
4d4d5726ae status: show worktree status of conflicted paths separately
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 <gitster@pobox.com>
2009-08-06 21:16:01 -07:00
Junio C Hamano
50b7e70f33 wt-status.c: rework the way changes to the index and work tree are summarized
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 <gitster@pobox.com>
2009-08-06 08:36:53 -07:00
Junio C Hamano
26da1d7867 diff-index: keep the original index intact
When comparing the index and a tree, we used to read the contents of the
tree into stage #1 of the index and compared them with stage #0.  In order
not to lose sight of entries originally unmerged in the index, we hoisted
them to stage #3 before reading the tree.

Commit d1f2d7e (Make run_diff_index() use unpack_trees(), not read_tree(),
2008-01-19) changed all this.  These days, we instead use unpack_trees()
API to traverse the tree and compare the contents with the index, without
modifying the index at all.  There is no reason to hoist the unmerged
entries to stage #3 anymore.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-05 02:21:11 -07:00
Junio C Hamano
29796c6ccf diff-index: report unmerged new entries
Since an earlier change to diff-index by d1f2d7e (Make run_diff_index()
use unpack_trees(), not read_tree(), 2008-01-19), we stopped reporting an
unmerged path that does not exist in the tree, but we should.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-05 02:21:11 -07:00
André Goddard Rosa
07a4a3b496 Fix typos on pt_BR/gittutorial.txt translation
With extra fixes from Thadeu and Carlos as well.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Carlos R. Mafra <crmafra2@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-31 11:24:18 -07:00
Wesley J. Landaker
2da846e709 Documentation: git-send-email: correct statement about standard ports
The current documentation states that servers typically listen on port
465 and calls this "ssmtp". While it's true that many mail servers use
port 465 for SSL smtp, this is non-standard, and hails from the days
before smtp and submission TLS support, that arrived in RFC2487 and
RFC3207. Port 465 is actually assigned by IANA for unrelated purposes,
and is mostly still used by mail servers today only to support Outlook
Express.

In any case, this patch helps the documentation better reflect both
standards and reality, while still helpfully mentioning ports numbers
that a user may wish to specify.

Signed-off-by: Wesley J. Landaker <wjl@icecavern.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-31 11:22:50 -07:00
Wesley J. Landaker
a4782b3d6e Documentation: git-send-email: fix submission port number
The current documentation confuses non-standard SSL smtp port 465 with
submission port 587 (RFC 4406). This patch just changes the referenced
number.

Signed-off-by: Wesley J. Landaker <wjl@icecavern.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-31 08:39:07 -07:00
Geoffrey Irving
79559f27be git fast-export: add --no-data option
When using git fast-export and git fast-import to rewrite the history
of a repository with large binary files, almost all of the time is
spent dealing with blobs.  This is extremely inefficient if all we want
to do is rewrite the commits and tree structure.  --no-data skips the
output of blobs and writes SHA-1s instead of marks, which provides a
massive speedup.

Signed-off-by: Geoffrey Irving <irving@naml.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-31 07:48:09 -07:00
Johannes Schindelin
86b5efb286 parse-opt: optionally show "--no-" option string
It is usually better to have positive options, to avoid confusing double
negations.  However, sometimes it is desirable to show the negative option
in the help.

Introduce the flag PARSE_OPT_NEGHELP to do that.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-31 07:47:38 -07:00
Thadeu Lima de Souza Cascardo
e658002005 Translate the tutorial to Brazillian Portuguese
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29 12:19:43 -07:00
Junio C Hamano
133cfaeb8b request-pull: optionally show a patch as well
Allow git request-pull to append diff body into the pull request.

It's useful for small series of commits.

Tested-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29 11:02:49 -07:00
Junio C Hamano
b65954d172 Merge branch 'hv/cvsps-tests'
* hv/cvsps-tests:
  t/t9600: remove exit after test_done
  cvsimport: extend testcase about patchset order to contain branches
  cvsimport: add test illustrating a bug in cvsps
  Add a test of "git cvsimport"'s handling of tags and branches
  Add some tests of git-cvsimport's handling of vendor branches
  Test contents of entire cvsimported "master" tree contents
  Use CVS's -f option if available (ignore user's ~/.cvsrc file)
  Start a library for cvsimport-related tests
2009-07-29 10:39:57 -07:00
Alex Riesen
1c9b2d3aa1 Add a reminder test case for a merge with F/D transition
The problem is that if a file was replaced with a directory containing
another file with the same content and mode, an attempt to merge it
with a branch descended from a commit before this F->D transition will
cause merge-recursive to break. It breaks even if there were no
conflicting changes on that other branch.

Originally reported by Anders Melchiorsen.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29 10:26:10 -07:00
Junio C Hamano
6641575963 Start 1.6.5 cycle
The next major release will be 1.6.5, hopefully with a shorter cycle
than the 1.6.4 cycle.  After that in 1.7.0 we can make potentially
backward incompatible changes if necessary.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29 09:33:29 -07:00
Junio C Hamano
0a53e9ddea GIT 1.6.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29 00:32:42 -07:00
Junio C Hamano
441b40d833 Sync with 1.6.3.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29 00:00:56 -07:00
Junio C Hamano
e276f018f2 GIT 1.6.3.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-28 23:59:30 -07:00
Stephen Boyd
5c6d8bb290 config.txt: document add.ignore-errors
Use the description of "--ignore-errors" from git-add.txt as
inspiration.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-28 23:56:01 -07:00
Tom Grennan
33016c4913 request-pull: allow ls-remote to notice remote.$nickname.uploadpack
The location to pull from should be converted from the configured nickname
to URL in the message, but ls-remote should be fed the nickname so that
the command uses remote.$nickname.* variables, most notably "uploadpack".

Signed-off-by: Tom Grennan <tgrennan@redback.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-28 23:31:38 -07:00
David Kågedal
f552e51ef9 Update the documentation of the raw diff output format
This includes mentioning the initial hash output of diff-tree, and
changes the header to "raw output format" which is more descriptive.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-28 13:32:59 -07:00
Michael J Gruber
02944cc492 git-rerere.txt: Clarify ambiguity of the config variable
Use the less ambiguous
"set variable foo in order to enable bar"
rather than
"set variable foo to enable bar" which may trick users into
assuming that "enable" is a good value for "foo".

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-28 13:30:42 -07:00
Eric Wong
df73af5f66 t9143: do not fail if Compress::Zlib is missing
"git svn gc" will not compress unhandled.log files if
Compress::Zlib is missing.  However, leftover index files should
always be removed, so add a test for this behavior as well.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-26 11:51:45 -07:00
Sean Estabrooks
e24c76bf09 Trivial path quoting fixes in git-instaweb
Bodo Schlecht noticed that Instaweb didn't propely quote all
path instances in the Apache config file it generated.

Acked-by: Eric Wong <normalperson@yhbt.net>

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-26 11:27:27 -07:00
Junio C Hamano
d1926f63ec Merge branch 'gp/maint-rebase-p-onto'
* gp/maint-rebase-p-onto:
  Fix rebase -p --onto
2009-07-26 11:24:13 -07:00
Junio C Hamano
feab68cd91 Merge branch 'en/fast-export'
* en/fast-export:
  fast-export: Document the fact that git-rev-list arguments are accepted
  Add new fast-export testcases
  fast-export: Add a --tag-of-filtered-object option for newly dangling tags
  fast-export: Do parent rewriting to avoid dropping relevant commits
  fast-export: Make sure we show actual ref names instead of "(null)"
  fast-export: Omit tags that tag trees
  fast-export: Set revs.topo_order before calling setup_revisions
2009-07-26 11:23:52 -07:00
Junio C Hamano
d8f7be2ebc GIT 1.6.4-rc3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-26 00:05:34 -07:00