1
0
mirror of https://github.com/git/git.git synced 2024-10-04 07:32:33 +02:00
Commit Graph

7560 Commits

Author SHA1 Message Date
Robert Fitzsimons
d222984e36 gitweb: Fix shortlog only showing HEAD revision.
My change in 190d7fdcf325bb444fa806f09ebbb403a4ae4ee6 had a small bug
found by Michael Krufky which caused the passed in hash value to be
ignored, so shortlog would only show the HEAD revision.

Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03 12:48:39 -08:00
Junio C Hamano
60c0f8462f git-verify-tag: make sure we remove temporary file.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03 12:34:20 -08:00
Santi Béjar
0bc72abdb0 git-tag: add flag to verify a tag
This way "git tag -v $tag" is the UI for git-verify-tag.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03 12:31:43 -08:00
Lars Hjemli
af0e4ac0ec Refactor print-functions in builtin-branch
This moves the guts of print_ref_list() into a revamped print_ref_info(),
which at the same time gets renamed to print_ref_item().

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03 12:19:20 -08:00
Jakub Narebski
1ebb948f65 gitweb: There can be empty patches (in git_patchset_body)
We now do not skip over empty patches in git_patchset_body
(where empty means that they consist only of git diff header,
and of extended diff header), so uncomment branch of code dealing
with empty patches (patches which do not have even two-line
from/to header)

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03 12:19:20 -08:00
Jakub Narebski
6e72cf43a7 gitweb: Fix bug in git_difftree_body (was '!=' instead of 'ne')
Fix bug in git_difftree_body subroutine; it was used '!=' comparison
operator for strings (file type) instead of correct 'ne'.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03 12:19:20 -08:00
Santi Béjar
9c9410e115 Documentation/tutorial: misc updates
- Teach how to delete a branch with "git branch -d name".
 - Usually a commit has one parent; merge has more.
 - Teach "git show" instead of "git cat-file -p".

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03 12:19:20 -08:00
Junio C Hamano
c1d179f88a tutorial: misc updates.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03 08:38:01 -08:00
Lars Hjemli
f3a47405bb Skip excessive blank lines before commit body
This modifies pretty_print_commit() to make the output of git-rev-list and
friends a bit more predictable.

A commit body starting with blank lines might be unheard-of, but still possible
to create using git-commit-tree (so is bound to appear somewhere, sometime).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03 08:29:01 -08:00
Brian Gernhardt
f3673988ec Add documentation for git-branch's color configuration.
Added color.branch and color.branch.<slot> to configuration list.
Style copied from color.status and meanings derived from the code.

Moved the color meanings from color.diff.<slot> to color.branch.<slot>
since the latter comes first alphabetically.

Added --color and --no-color to git-branch's usage and documentation.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03 08:16:02 -08:00
Jakub Narebski
956259ee74 gitweb: Fix error in git_project_index subroutine
Instead of "$projectroot/$pr->{'path'}" to get the path to project
GIT_DIR, it was used "$projectroot/$project" which is valid only
for actions where project parameter is set, and 'project_index' is not
one of them.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03 08:14:46 -08:00
Junio C Hamano
1084b845d9 Fix infinite loop when deleting multiple packed refs.
It was stupid to link the same element twice to lock_file_list
and end up in a loop, so we certainly need a fix.

But it is not like we are taking a lock on multiple files in
this case.  It is just that we leave the linked element on the
list even after commit_lock_file() successfully removes the
cruft.

We cannot remove the list element in commit_lock_file(); if we
are interrupted in the middle of list manipulation, the call to
remove_lock_file_on_signal() will happen with a broken list
structure pointed by lock_file_list, which would cause the cruft
to remain, so not removing the list element is the right thing
to do.  Instead we should be reusing the element already on the
list.

There is already a code for that in lock_file() function in
lockfile.c.  The code checks lk->next and the element is linked
only when it is not already on the list -- which is incorrect
for the last element on the list (which has NULL in its next
field), but if you read the check as "is this element already on
the list?" it actually makes sense.  We do not want to link it
on the list again, nor we would want to set up signal/atexit
over and over.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03 01:22:35 -08:00
Jürgen Rühle
3c1eb9cb2d Improve cached content header of status output
This tries to be more to the point while also including a pointer on how to
unstage changes from the index.

Since this header is printed in two different code paths and the name of the
reference commit is needed for the unstage part, provide a new printing
function.

Signed-off-by: Jürgen Rühle <j-r@online.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-02 23:43:50 -08:00
Jürgen Rühle
98bf8a47c2 Support --amend on initial commit in status output
We check the existence of the parent commit to determine whether the status is
requested for an initial commit. Since the parent commit depends on the
presence of the --amend switch do initial commit detection after command line
arguments have been handled.

Signed-off-by: Jürgen Rühle <j-r@online.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-02 23:43:31 -08:00
Jürgen Rühle
6e458bf63f Improve "nothing to commit" part of status output
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 <j-r@online.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-02 23:43:21 -08:00
Jürgen Rühle
e54eef9e1f Clarify syntax and role of git-add in status output
This uses the actual (simplified) synopsis line from the git-add man page and
advertises its incremental nature.

Signed-off-by: Jürgen Rühle <j-r@online.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-02 23:41:12 -08:00
Andy Whitcroft
825cee7b28 send pack check for failure to send revisions list
When passing the revisions list to pack-objects we do not check for
errors nor short writes.  Introduce a new write_in_full which will
handle short writes and report errors to the caller.  Use this to
short cut the send on failure, allowing us to wait for and report
the child in case the failure is its fault.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-02 23:33:21 -08:00
Eric Wong
44a167b007 instaweb: load Apache mime and dir modules if they are needed
I've noticed that Apache 2.2 on a Debian etch machine has
these compiled as modules.

Also set ServerName to avoid a warning at startup.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-02 23:25:42 -08:00
Junio C Hamano
54b9e0225a fetch-pack: do not use lockfile structure on stack.
They are used in atexit() for clean-up, and you will be
accessing unallocated memory at that point.

See 31f584c2 for the fix for a similar problem.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-02 11:22:08 -08:00
Junio C Hamano
96a738c0dd Remove unused variable (git-commit.sh)
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-01 23:42:53 -08:00
Junio C Hamano
f4bf2184ae Update clone/fetch documentation with --depth (shallow clone) option
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-01 15:08:06 -08:00
Junio C Hamano
a597fb0e71 Strongly discourage --update-head-ok in fetch-options documentation.
"Use it with care" is a wrong wording to say "this is purely internal
and you are supposed to know what you are doing if you use this".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-01 15:07:35 -08:00
Junio C Hamano
9066f4ef2f Merge branch 'sp/merge' (early part)
* 'sp/merge' (early part):
  Use merge-recursive in git-am -3.
  Allow merging bare trees in merge-recursive.
  Move better_branch_name above get_ref in merge-recursive.
2007-01-01 14:40:37 -08:00
J. Bruce Fields
6f0b4ac0d7 Documentation: remove master:origin example from pull-fetch-param.txt
This is no longer a useful example.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-01 14:38:08 -08:00
J. Bruce Fields
33a59fd07d Documentation: update git-pull.txt for new clone behavior
Update examples, stop using branch named "origin" as an example.
Remove large example of use of remotes; that particular case is
nicely automated by default, so it's not so pressing to explain, and
we can refer to git-repo-config for the details.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-01 14:36:36 -08:00
Junio C Hamano
ac9c1108d8 git-fetch: remove .keep file at the end.
Removal of them is needed regardless of errors.  The original
code had the removal outside of the process which sets the flag
to tell the later step what to remove, but it runs as a
downstream of a pipeline and its effect was lost.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-01 14:36:01 -08:00
Junio C Hamano
d1014a1745 fail pull/merge early in the middle of conflicted merge
After a pull that results in a conflicted merge, a new user
often tries another "git pull" in desperation.  When the index
is unmerged, merge backends correctly bail out without touching
either index nor the working tree, so this does not make the
wound any worse.

The user will however see several lines of messsages during this
process, such as "filename: needs merge", "you need to resolve
your current index first", "Merging...", and "Entry ... would be
overwritten by merge. Cannot merge.".  They are unnecessarily
alarming, and cause useful conflict messages from the first pull
scroll off the top of the terminal.

This changes pull and merge to run "git-ls-files -u" upfront and
stop them much earlier than we currently do.  Old timers may
know better and would not to try pulling again before cleaning
things up; this change adds extra overhead that is unnecessary
for them.  But this would be worth paying for to save new people
from needless confusion.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-01 14:35:16 -08:00
Junio C Hamano
9d0524d42f Update send-pack pipeline documentation.
The pipeline was much more complex and needed documentation, but
now it is trivial and straightforward.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-01 14:35:16 -08:00
Eric Wong
4385355454 git-svn: t/t91??-*: optimize the tests a bit
This removes some unnecessary 'svn up' calls throughout

t9103-git-svn-graft-branches.sh:
  * removed an 'svn log' call that was leftover from debugging
  * removed multiple git-svn calls with a multi-init / multi-fetch
    combination (which weren't tested before, either)
  * replaced `rev-list ... | head -n1` with `rev-parse ...`
    (not sure what I was thinking when I wrote that)

All this saves about 9 seconds from a test run
(53s -> 44s for 'make t91*') on my 1.3GHz Athlon

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 23:40:52 -08:00
Eric Wong
5bd3870c37 git-svn: t/t9100-git-svn-basic: remove old check for NO_SYMLINK
We don't support the svn command-line client anymore; nor
do we support anything before SVN 1.1.0, so we can be certain
symlinks will be supported in the SVN repository.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 23:40:52 -08:00
Eric Wong
c6d499a82f git-svn: remove svnadmin dependency from the tests
We require the libraries now, so we can create repositories
using them (and save some executable load time while we're at
it).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 23:40:52 -08:00
Junio C Hamano
e90068a904 i18n: do not leak 'encoding' header even when we cheat the conversion.
We special case the case where encoding recorded in the commit
and the output encoding are the same and do not call iconv().
But we should drop 'encoding' header for this case as well for
consistency.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 18:55:28 -08:00
Junio C Hamano
fbc9012307 Do not merge random set of refs out of wildcarded refs
When your fetch configuration has only the wildcards, we would
pick the lexicographically first ref from the remote side for
merging, which was complete nonsense.  Make sure nothing except
the one that is specified with branch.*.merge is merged in this
case.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 18:53:26 -08:00
Theodore Tso
63c97ce228 Fix formatting for urls section of fetch, pull, and push manpages
Updated to make the nroff'ed man pages look nicer.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 18:40:17 -08:00
J. Bruce Fields
d66409f068 Documentation: update tutorial's discussion of origin
Update tutorial's discussion of origin branch to reflect new defaults,
and include a brief mention of git-repo-config.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 16:44:41 -08:00
J. Bruce Fields
f65bb2c66f Documentation: update glossary entry for "origin"
Update glossary entry for "origin" to reflect fact that it normally now refers
to a remote repository, not a branch.

Also, warning not to work on remote-tracking branches is no longer necessary
since git doesn't allow that.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 16:37:20 -08:00
J. Bruce Fields
36566cc0bc Documentation: update git-clone.txt for clone's new default behavior
Fix a couple remaining references to the origin branch.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 16:16:10 -08:00
J. Bruce Fields
c04197ee1e Docs: update cvs-migration.txt to reflect clone's new default behavior
I couldn't think of a really quick way to give all the details, so just refer
readers to the git-repo-config man page instead.

I haven't tested recent cvs import behavior--some time presumably it should be
updated to do something more similar to clone.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 16:15:12 -08:00
Junio C Hamano
0ae5f98c7b send-pack: tell pack-objects to use its internal rev-list.
This means one less process in the pipeline to worry about, and
removes about 1/8 of the code.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 01:26:53 -08:00
Junio C Hamano
4b4ee90e58 send-pack.c: use is_null_sha1()
Everybody else uses is_null_sha1() -- there is no point to have its
own is_zero_sha1() anymore.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 00:59:53 -08:00
Junio C Hamano
87a3d29f46 Update documentation for update hook.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 00:52:25 -08:00
Junio C Hamano
cc06c87068 Merge branch 'jc/send-pack-pipeline'
* jc/send-pack-pipeline:
  Documentation: illustrate send-pack pipeline.
  send-pack: fix pipeline.
2006-12-31 00:31:26 -08:00
Shawn O. Pearce
27086d0f84 Add test case for update hooks in receive-pack.
Verify that the update hooks work as documented/advertised.  This is
a simple set of tests to check that the update hooks run with the
parameters expected, have their STDOUT and STDERR redirected to
the client side of the connection, and that their STDIN does not
contain any data (as its actually /dev/null).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-31 00:21:37 -08:00
Shawn O. Pearce
eb92242f19 Update packedGit config option documentation.
Corrected minor typos and documented the new k/m/g suffix for
core.packedGitWindowSize and core.packedGitLimit.

[jc: with a minor markup fix.]

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-30 22:45:00 -08:00
Junio C Hamano
76d4e079ad Merge branch 'master' into sp/mmap
* master:
  Documentation/config.txt (and repo-config manpage): mark-up fix.
  Teach Git how to parse standard power of 2 suffixes.
  Use /dev/null for update hook stdin.
  Redirect update hook stdout to stderr.
  Remove unnecessary argc parameter from run_command_v.
  Automatically detect a bare git repository.
  Replace "GIT_DIR" with GIT_DIR_ENVIRONMENT.
  Use PATH_MAX constant for --bare.
  Force core.filemode to false on Cygwin.
  Fix formatting for urls section of fetch, pull, and push manpages
  Fix yet another subtle xdl_merge() bug
  i18n: drop "encoding" header in the output after re-coding.
  commit-tree: cope with different ways "utf-8" can be spelled.
  Move commit reencoding parameter parsing to revision.c
  Documentation: minor rewording for git-log and git-show pages.
  Documentation: i18n commit log message notes.
  t3900: test log --encoding=none
  commit re-encoding: fix confusion between no and default conversion.
2006-12-30 22:42:43 -08:00
Junio C Hamano
a862f97e98 Documentation/config.txt (and repo-config manpage): mark-up fix.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-30 22:39:24 -08:00
Shawn O. Pearce
d77a64d353 Teach Git how to parse standard power of 2 suffixes.
Sometimes its necessary to supply a value as a power of two in a
configuration parameter.  In this case the user may want to use the
standard suffixes such as K, M, or G to indicate that the numerical
value should be multiplied by a constant base before being used.

Shell scripts/etc. can also benefit from this automatic option
parsing with `git repo-config --int`.

[jc: with a couple of test and a slight input tightening]

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-30 22:22:14 -08:00
Shawn O. Pearce
95d3c4f546 Use /dev/null for update hook stdin.
Currently the update hook invoked by receive-pack has its stdin
connected to the pushing client.  The hook shouldn't attempt to
read from this stream, and doing so may consume data that was
meant for receive-pack.  Instead we should give the update hook
/dev/null as its stdin, ensuring that it always receives EOF and
doesn't disrupt the protocol if it attempts to read any data.

The post-update hook is similar, as it gets invoked with /dev/null
on stdin to prevent the hook from reading data from the client.
Previously we had invoked it with stdout also connected to /dev/null,
throwing away anything on stdout, to prevent client protocol errors.
Instead we should redirect stdout to stderr, like we do with the
update hook.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-30 22:22:14 -08:00
Shawn O. Pearce
cd83c74cb3 Redirect update hook stdout to stderr.
If an update hook outputs to stdout then that output will be sent
back over the wire to the push client as though it were part of
the git protocol.  This tends to cause protocol errors on the
client end of the connection, as the hook output is not expected
in that context.  Most hook developers work around this by making
sure their hook outputs everything to stderr.

But hooks shouldn't need to perform such special behavior.  Instead
we can just dup stderr to stdout prior to invoking the update hook.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-30 22:22:14 -08:00
Shawn O. Pearce
9b0b50936e Remove unnecessary argc parameter from run_command_v.
The argc parameter is never used by the run_command_v family of
functions.  Instead they require that the passed argv[] be NULL
terminated so they can rely on the operating system's execvp
function to correctly pass the arguments to the new process.

Making the caller pass the argc is just confusing, as the caller
could be mislead into believing that the argc might take precendece
over the argv, or that the argv does not need to be NULL terminated.
So goodbye argc.  Don't come back.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-30 22:22:14 -08:00