Commit Graph

15008 Commits

Author SHA1 Message Date
Junio C Hamano
c0234b2ef6 stat_tracking_info(): clear object flags used during counting
When left-right traversal counts the commits in a diverged history, it
leaves the flags in the commits smudged, and we need to clear them before
we return.  Otherwise the caller cannot inspect other branches with this
function again.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-03 12:14:53 -07:00
Junio C Hamano
94fcb730ff git-branch -v: show the remote tracking statistics
This teaches "git branch -v" to insert the remote tracking statistics in
brackets, just before the one-liner commit log message for the branch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-02 23:32:25 -07:00
Junio C Hamano
b6975ab59b git-status: show the remote tracking statistics
This teaches "git status" to show the same remote tracking statistics
"git checkout" gives at the beginning of the output.

Now the necessary low-level machinery is properly factored out, we can do
this quite cleanly.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-02 23:32:25 -07:00
Junio C Hamano
6d21bf96b5 Refactor "tracking statistics" code used by "git checkout"
People seem to like "Your branch is ahead by N commit" report made by
"git checkout", but the interface into the statistics function was a bit
clunky.  This splits the function into three parts:

 * The core "commit counting" function that takes "struct branch" and
   returns number of commits to show if we are ahead, behind or forked;

 * Convenience "stat formating" function that takes "struct branch" and
   formats the report into a given strbuf, using the above function;

 * "checkout" specific function that takes "branch_info" (type that is
   internal to checkout implementation), calls the above function and
   print the formatted result.

in the hope that the former two can be more easily reusable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-02 23:32:25 -07:00
Thomas Rast
6cbf8b00fb git-send-email: Do not attempt to STARTTLS more than once
With the previous TLS patch, send-email would attempt to STARTTLS at
the beginning of every mail, despite reusing the last connection.  We
simply skip further encryption checks after successful TLS initiation.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-02 22:41:18 -07:00
Junio C Hamano
bb1ab2db08 Merge branch 'j6t/mingw'
* j6t/mingw: (38 commits)
  compat/pread.c: Add a forward declaration to fix a warning
  Windows: Fix ntohl() related warnings about printf formatting
  Windows: TMP and TEMP environment variables specify a temporary directory.
  Windows: Make 'git help -a' work.
  Windows: Work around an oddity when a pipe with no reader is written to.
  Windows: Make the pager work.
  When installing, be prepared that template_dir may be relative.
  Windows: Use a relative default template_dir and ETC_GITCONFIG
  Windows: Compute the fallback for exec_path from the program invocation.
  Turn builtin_exec_path into a function.
  Windows: Use a customized struct stat that also has the st_blocks member.
  Windows: Add a custom implementation for utime().
  Windows: Add a new lstat and fstat implementation based on Win32 API.
  Windows: Implement a custom spawnve().
  Windows: Implement wrappers for gethostbyname(), socket(), and connect().
  Windows: Work around incompatible sort and find.
  Windows: Implement asynchronous functions as threads.
  Windows: Disambiguate DOS style paths from SSH URLs.
  Windows: A rudimentary poll() emulation.
  Windows: Implement start_command().
  ...
2008-07-02 21:57:52 -07:00
Junio C Hamano
7d3580d74c Merge branch 'maint'
* maint:
  Fix describe --tags --long so it does not segfault
2008-07-02 21:57:50 -07:00
Junio C Hamano
182c5afa6c Merge branch 'js/maint-clone-insteadof' into maint
* js/maint-clone-insteadof:
  clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig
  clone: respect url.insteadOf setting in global configs
2008-07-02 21:32:44 -07:00
Junio C Hamano
1f42b8e199 Merge branch 'jk/maint-fetch-ref-hier' into maint
* jk/maint-fetch-ref-hier:
  fetch: give a hint to the user when local refs fail to update
  fetch: report local storage errors in status table
2008-07-02 21:32:44 -07:00
Junio C Hamano
4df0d7af6b Merge branch 'jc/maint-reset' into maint
* jc/maint-reset:
  Allow "git-reset path" when unambiguous
2008-07-02 21:32:44 -07:00
Shawn O. Pearce
14d4642e2a Fix describe --tags --long so it does not segfault
If we match a lightweight (non-annotated tag) as the name to
output and --long was requested we do not have a tag, nor do
we have a tagged object to display.  Instead we must use the
object we were passed as input for the long format display.

Reported-by: Mark Burton <markb@ordern.com>
Backtraced-by: Mikael Magnusson <mikachu@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-02 21:21:59 -07:00
Johannes Schindelin
8cb560fc47 git fetch-pack: do not complain about "no common commits" in an empty repo
If the repo is empty, it is obvious that there are no common commits
when fetching from _anywhere_.

So there is no use in saying it in that case, and it can even be
annoying.  Therefore suppress the message unilaterally if the repository
is empty prior to the fetch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-02 11:54:22 -07:00
Brian Gernhardt
dc49308450 Documentation: Point to gitcli(7) from git(1)
Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-02 11:54:19 -07:00
Junio C Hamano
e903b4095a Update draft release notes for 1.6.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:47:31 -07:00
Nanako Shiraishi
aa0c1f2001 gitcli: Document meaning of --cached and --index
We saw this explanation repeated on the mailing list a few times.  Even
though the description of individual options to particular commands are
explained in their manual pages, the reason behind choosing which is which
has not been clearly explained in any of the documentation.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:29:38 -07:00
Jonathan Nieder
483bc4f045 Documentation formatting and cleanup
Following what appears to be the predominant style, format
names of commands and commandlines both as `teletype text`.

While we're at it, add articles ("a" and "the") in some
places, italicize the name of the command in the manual page
synopsis line, and add a comma or two where it seems appropriate.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:20:16 -07:00
Jonathan Nieder
b1889c36d8 Documentation: be consistent about "git-" versus "git "
Since the git-* commands are not installed in $(bindir), using
"git-command <parameters>" in examples in the documentation is
not a good idea. On the other hand, it is nice to be able to
refer to each command using one hyphenated word. (There is no
escaping it, anyway: man page names cannot have spaces in them.)

This patch retains the dash in naming an operation, command,
program, process, or action. Complete command lines that can
be entered at a shell (i.e., without options omitted) are
made to use the dashless form.

The changes consist only of replacing some spaces with hyphens
and vice versa. After a "s/ /-/g", the unpatched and patched
versions are identical.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:20:15 -07:00
Jonathan Nieder
46e56e81b3 Documentation: prepare to be consistent about "git-" versus "git "
With the dashed forms of git commands not in $(bindir), we have
to change many instances of "git-command" to "git command". Also,
for consistency it is at times appropriate to make the opposite
change. In some cases, the change is not so simple as changing one
character.

This patch gets rid of some of those cases by rewrapping lines.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:20:09 -07:00
Jonathan Nieder
963a653fa6 git-daemon(1): don't assume git-daemon is in /usr/bin
In the example inetd.conf lines in git-daemon(1), it was
assumed that `git-daemon` resides in the user's /usr/bin.
With this patch, we only assume `git` is in /usr/bin.

The stronger assumption fails in the default installation
nowadays.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:20:09 -07:00
Jonathan Nieder
3861cd5582 Documentation: complicate example of "man git-command"
The manual page for the command invoked as "git clone" is named
git-clone(1), and similarly for the rest of the git commands.
Make sure our first example of this in tutorials makes it clear
that it is the first two words of a command line that make up the
command's name (that is: for example, the effect of "git svn
dcommit" is described in git-svn(1)).

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:20:09 -07:00
Jonathan Nieder
3f2d1ee89f whitespace fix in Documentation/git-repack.txt
Change leading spaces to tabs to match the rest of the file.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:20:09 -07:00
Jonathan Nieder
6998e4db52 Documentation: fix links to tutorials and other new manual pages
With the conversion of HTML documentation to man pages

tutorial.html -> gittutorial (7)
tutorial-2.html -> gittutorial-2 (7)
cvs-migration.html -> gitcvs-migration (7)
diffcore.html -> gitdiffcore (7)
repository-layout.html -> gitrepository-layout (5)
hooks.html -> githooks (5)
glossary.html -> gitglossary (7)
core-tutorial.html -> gitcore-tutorial (7)

and the automatic update of references to these pages,
a little debris was left behind. We clear it away.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:20:09 -07:00
Junio C Hamano
951b09ce36 Merge maint in 2008-07-01 17:19:34 -07:00
Junio C Hamano
7ad0f27b92 Start draft release notes for 1.5.6.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:09:21 -07:00
Thomas Rast
4f3dcc2753 Fix 'git show' on signed tag of signed tag of commit
The cmd_show loop resolves tags by showing them, then pointing the
object to the 'tagged' member.  However, this object is not fully
initialized; it only contains the SHA1.  (This resulted in a segfault
if there were two levels of tags.)  We apply parse_object to get a
full object.

Noticed by Kalle Olavi Niemitalo on IRC.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 17:05:42 -07:00
Junio C Hamano
5e707b28d9 Merge branch 'ph/mergetool'
* ph/mergetool:
  Remove the use of '--' in merge program invocation
2008-07-01 16:22:42 -07:00
Junio C Hamano
27158e463a Merge branch 'js/apply-recount'
* js/apply-recount:
  Allow git-apply to recount the lines in a hunk (AKA recountdiff)
2008-07-01 16:22:39 -07:00
Junio C Hamano
d4b76e15ea Merge branch 'jc/checkdiff'
* jc/checkdiff:
  Fix t4017-diff-retval for white-space from wc
  Update sample pre-commit hook to use "diff --check"
  diff --check: detect leftover conflict markers
  Teach "diff --check" about new blank lines at end
  checkdiff: pass diff_options to the callback
  check_and_emit_line(): rename and refactor
  diff --check: explain why we do not care whether old side is binary
2008-07-01 16:22:35 -07:00
Junio C Hamano
f7c3cf8106 Merge branch 'kb/send-email-fifo'
* kb/send-email-fifo:
  git-send-email: Accept fifos as well as files
2008-07-01 16:22:29 -07:00
Junio C Hamano
74c3664186 Merge branch 'tr/send-email-ssl'
* tr/send-email-ssl:
  git-send-email: prevent undefined variable warnings if no encryption is set
  git-send-email: add support for TLS via Net::SMTP::SSL
2008-07-01 16:22:25 -07:00
Junio C Hamano
48c12d4b9b Merge branch 'js/maint-clone-insteadof'
* js/maint-clone-insteadof:
  clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig
  clone: respect url.insteadOf setting in global configs
2008-07-01 16:22:22 -07:00
Junio C Hamano
24cd49f627 Merge branch 'jc/maint-reset'
* jc/maint-reset:
  Allow "git-reset path" when unambiguous
2008-07-01 16:22:19 -07:00
Junio C Hamano
e74776b0d8 Merge branch 'jk/maint-fetch-ref-hier'
* jk/maint-fetch-ref-hier:
  fetch: give a hint to the user when local refs fail to update
  fetch: report local storage errors in status table
2008-07-01 16:22:14 -07:00
Junio C Hamano
7ebd52aa0e Merge branch 'dz/apply-again'
* dz/apply-again:
  git-apply: handle a patch that touches the same path more than once better
2008-07-01 16:22:10 -07:00
Junio C Hamano
a08ca90938 Merge branch 'np/pack-default'
* np/pack-default:
  pack.indexversion config option now defaults to 2
  repack.usedeltabaseoffset config option now defaults to "true"
2008-07-01 16:22:07 -07:00
Junio C Hamano
9d54ea6760 Merge branch 'jc/dashless' (early part)
* 'jc/dashless' (early part):
  Prepare execv_git_cmd() for removal of builtins from the filesystem
  git-shell: accept "git foo" form
2008-07-01 15:21:52 -07:00
Junio C Hamano
605acb6d0d Merge branch 'nd/dashless'
* nd/dashless:
  Keep some git-* programs in $(bindir)
  Move all dashed-form commands to libexecdir
2008-07-01 15:21:40 -07:00
Junio C Hamano
66037991d3 Merge branch 'maint'
* maint:
  doc/rev-parse: clarify reflog vs --until for specifying revisions
2008-06-30 00:44:19 -07:00
Brian Gernhardt
f9d800e207 Add test results directory to t/.gitignore
We don't need test results to be committed if we're fixing a test.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-30 00:36:39 -07:00
Jeff King
f3cb169bc9 fetch: give a hint to the user when local refs fail to update
There are basically two categories of update failures for
local refs:

  1. problems outside of git, like disk full, bad
     permissions, etc.

  2. D/F conflicts on tracking branch ref names

In either case, there should already have been an error
message. In case '1', hopefully enough information has
already been given that the user can fix it. In the case of
'2', we can hint that the user can clean up their tracking
branch area by using 'git remote prune'.

Note that we don't actually know _which_ case we have, so
the user will receive the hint in case 1, as well. In this
case the suggestion won't do any good, but hopefully the
user is smart enough to figure out that it's just a hint.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29 23:47:41 -07:00
Jeff King
a0d2ceb276 doc/rev-parse: clarify reflog vs --until for specifying revisions
The rev-parse manpage introduces the branch@{date} syntax,
and mentions the reflog specifically. However, new users may
not be familiar with the distinction between the reflog and
the commit date, so let's help them out with a "you may be
interested in --until" pointer.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29 23:47:26 -07:00
Junio C Hamano
0e047bd14c Update draft release notes for 1.6.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29 23:28:47 -07:00
jrnieder@uchicago.edu
bd870878f8 Documentation: don't assume git-sh-setup and git-parse-remote are in PATH
When git-parse-remote and git-sh-setup are not installed in
$(bindir) anymore, the shell script library won't be found on
user's $PATH in general.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29 23:28:47 -07:00
Junio C Hamano
e46f9c8161 t9700: skip when Test::More is not available
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29 23:28:44 -07:00
Johannes Schindelin
5b8063b5b0 clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig
After initializing the config in the newly-created repository, we
need to unset GIT_CONFIG so that the global configs are read again.

Noticed by Pieter de Bie.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29 23:16:32 -07:00
Brian Gernhardt
ab20fda992 Fix t4017-diff-retval for white-space from wc
Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-29 15:11:50 -07:00
Junio C Hamano
8e69d78be3 Merge branch 'maint'
* maint:
  git-svn: don't sanitize remote names in config
  git-svn: avoid filling up the disk with temp files.
  git cat-file: Fix memory leak in batch mode
  fix git config example syntax
  avoid off-by-one error in run_upload_archive
2008-06-28 21:08:35 -07:00
Eric Wong
7829f20f5b git-svn: don't sanitize remote names in config
The original sanitization code was just taken from the
remotes2config.sh shell script in contrib.

Credit to Avery Pennarun for noticing this mistake, and Junio
for clarifying the rules for config section names:

Junio C Hamano wrote in <7vfxr23s6m.fsf@gitster.siamese.dyndns.org>:

> In
>
> 	[foo "bar"] baz = value
>
> foo and baz must be config.c::iskeychar() (and baz must be isalpha()), but
> "bar" can be almost anything.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28 20:55:45 -07:00
Olivier Marin
861d1af36a show_stats(): fix stats width calculation
Before this patch, name_width becomes negative or null for width values
less than 15 and name_width values greater than 25 (default: 50). This
leads to output random data.

This patch checks for minimal width and name_width values.

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28 20:55:26 -07:00
Olivier Marin
8813df9066 Documentation: remove {show,whatchanged}.difftree config options
This removes, from the documentation and the bash completion script, the
two config options that were introduced by the git-whatchanged.sh script
and lost in the C rewrite. Today, we can use aliases as an alternative.

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28 20:55:26 -07:00