1
0
mirror of https://github.com/git/git.git synced 2024-10-03 15:11:22 +02:00
Commit Graph

10646 Commits

Author SHA1 Message Date
Junio C Hamano
1a15fed84a Merge branch 'jk/add-empty' into ei/oneline+add-empty
* jk/add-empty:
  builtin-add: simplify (and increase accuracy of) exclude handling
  dir_struct: add collect_ignored option
2007-06-16 17:58:28 -07:00
Johannes Schindelin
4cd008a925 pp_header(): work around possible memory corruption
add_user_info() possibly adds way more than just the commit header line.
In fact, it sometimes needs so much more space that there is a buffer
overrun, leading to an ugly crash. For example, the date is printed in its
own line, and usually takes up more space than the equivalent Unix epoch.

So, for good measure, add 80 characters (a full line) to the allocated
space, in addition to the header line length.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 17:55:58 -07:00
Jeff King
c927e6c69b Fix ALLOC_GROW off-by-one
The ALLOC_GROW macro will never let us fill the array completely,
instead allocating an extra chunk if that would be the case. This is
because the 'nr' argument was originally treated as "how much we do have
now" instead of "how much do we want". The latter makes much more
sense because you can grow by more than one item.

This off-by-one never resulted in an error because it meant we were
overly conservative about when to allocate. Any callers which passed
"how much we have now" need to be updated, or they will fail to allocate
enough.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 17:55:44 -07:00
Jakub Narebski
2e88c26626 Document git log --full-diff
Based on description of commit 477f2b41310c4b1040a9e7f72720b9c39d82caf9
"git log --full-diff" adding this option.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 13:10:52 -07:00
Jakub Narebski
13120fdc5e Document git log --abbrev-commit, as a kind of pretty option
Documentation taken from paraphrased description of "--abbrev[=<n>]"
diff option, and from description of commit 5c51c985 introducing
this option.

Note that to change number of digits one must use "--abbrev=<n>",
which affects [also] diff output.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 13:10:49 -07:00
Jakub Narebski
ef3cb65c21 Use tabs for indenting definition list for options in git-log.txt
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 13:10:28 -07:00
Jakub Narebski
e3c1500fcf Document git rev-list --timestamp
Note that git log does not understand this option yet:

  $ git log --timestamp
  fatal: unrecognized argument: --timestamp

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 13:08:14 -07:00
Jakub Narebski
cb877cd7b6 Document git reflog --stale-fix
Document --stale-fix, used in "git reflog expire --stale-fix --all"
to remove invalid reflog entries, to fix situation after running
non reflog-aware git-prune from an older git in the presence of
reflogs (see RelNotes-1.5.0.txt).

Based on description of commit 1389d9ddaa68a4cbf5018d88f971b9bbb7aaa3c9
  "reflog expire --fix-stale"
which introduced this option.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 13:08:12 -07:00
Jakub Narebski
c9bf7be238 Document git rev-parse --is-inside-git-dir
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 13:08:11 -07:00
Jakub Narebski
6da0878302 Document git read-tree --trivial
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 13:08:09 -07:00
Jakub Narebski
29a6c3f804 Document git rev-list --full-history
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 13:08:05 -07:00
Benjamin Sergeant
da4a660161 git-p4 fails when cloning a p4 depo.
A perforce command with all the files in the repo is generated to get
all the file content.
Here is a patch to break it into multiple successive perforce command
who uses 4K of parameter max, and collect the output for later.

It works, but not for big depos, because the whole perforce depo
content is stored in memory in P4Sync.run(), and it looks like mine is
bigger than 2 Gigs, so I had to kill the process.

[Simon: I added the bit about using SC_ARG_MAX, as suggested by Han-Wen]

Signed-off-by: Benjamin Sergeant <bsergean@gmail.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-16 22:06:06 +02:00
Alex Riesen
7cbf2f24ee Do not use h_errno after connect(2): the function does not set it
Randal L. Schwartz noticed compilation problems on SunOS, which made
me look at the code again. The thing is, h_errno is not used by
connect(2), it is only for functions from netdb.h, like gethostbyname.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 09:11:58 -07:00
Junio C Hamano
3e48af3875 Documentation: update "stale" links for 1.5.2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 09:10:18 -07:00
Simon Hausmann
3c699645f5 Fix initial multi-branch import.
The list of existing p4 branches in git wasn't initialized.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-16 13:09:21 +02:00
Junio C Hamano
952c8c5638 Merge branch 'jc/remote'
* jc/remote:
  git-push: Update description of refspecs and add examples
  remote.c: "git-push frotz" should update what matches at the source.
  remote.c: fix "git push" weak match disambiguation
  remote.c: minor clean-up of match_explicit()
  remote.c: refactor creation of new dst ref
  remote.c: refactor match_explicit_refs()
2007-06-16 01:22:45 -07:00
Junio C Hamano
5c088a22e2 Merge branch 'gp/branch'
* gp/branch:
  git-branch: cleanup config file when deleting branches
2007-06-16 01:22:43 -07:00
Junio C Hamano
57bd934ea6 Merge branch 'fl/cvsserver'
* fl/cvsserver:
  cvsserver: Actually implement --export-all
  cvsserver: Let --base-path and pserver get along just fine
  cvsserver: Add some useful commandline options
2007-06-16 01:22:38 -07:00
Junio C Hamano
ad2a2f6f0b Merge branch 'lh/submodule'
* lh/submodule:
  gitmodules(5): remove leading period from synopsis
  Add gitmodules(5)
  git-submodule: give submodules proper names
  Rename sections from "module" to "submodule" in .gitmodules
  git-submodule: remember to checkout after clone
  t7400: barf if git-submodule removes or replaces a file
2007-06-16 01:22:35 -07:00
Junio C Hamano
5bd148bfe8 Merge branch 'maint' to sync with GIT 1.5.2.2 2007-06-16 01:22:10 -07:00
Sam Vilain
c5f71ad099 git-svn: avoid string eval for defining functions
You don't need to use string eval to define new functions; assigning a
code reference to the target symbol table is enough.

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

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 01:20:26 -07:00
Daniel Barkalow
efd8f793e4 Fix pushing to a pattern with no dst
Refspecs with no colons are left with no dst value, because they are
interepreted differently for fetch and push. For push, they mean to
reuse the src side. Fix this for patterns.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 01:20:26 -07:00
Junio C Hamano
c7c84859ad GIT 1.5.2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.5.2.2
2007-06-16 01:13:35 -07:00
Junio C Hamano
4c7100a9f4 Documentation: adjust to AsciiDoc 8
It turns out that the attribute definition we have had for a
long time to hide "^" character from AsciiDoc 7 was not honored
by AsciiDoc 8 even under "-a asciidoc7compatible" mode.  There is
a similar breakage with the "compatible" mode with + characters.

The double colon at the end of definition list term needs
to be attached to the term, without a whitespace.  After this
minimum fixups, AsciiDoc 8 (I used 8.2.1 on Debian) with
compatibility mode seems to produce reasonably good results.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-16 01:11:16 -07:00
Junio C Hamano
66e41f7b99 Avoid diff cost on "git log -z"
Johannes and Marco discovered that "git log -z" spent cycles in diff even
though there is no need to actually compute diffs.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-15 23:48:35 -07:00
Junio C Hamano
7b99befef7 git-branch --track: fix tracking branch computation.
The original code did not take hierarchical branch names into account at all.

[jc: cherry-picked 11f68d9 from 'master']

Tested-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-15 23:35:32 -07:00
Junio C Hamano
1367214417 $EMAIL is a last resort fallback, as it's system-wide.
$EMAIL is a system-wide setup that is used for many many many
applications. If the git user chose a specific user.email setup,
then _this_ should be honoured rather than $EMAIL.

[jc: cherry-picked ec563e8 from 'master']

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-15 23:33:06 -07:00
Johannes Schindelin
fadf488f9b merge-recursive: refuse to merge binary files
[jc: cherry-picked 9f30855 from 'master']

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-15 23:28:10 -07:00
Johannes Schindelin
634cd48a8a Move buffer_is_binary() to xdiff-interface.h
We already have two instances where we want to determine if a buffer
contains binary data as opposed to text.

[jc: cherry-picked 6bfce93e from 'master']

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-15 23:27:23 -07:00
Alex Riesen
fa0c87c344 Add a local implementation of hstrerror for the system which do not have it
The function converts the value of h_errno (last error of name
resolver library, see netdb.h).
One of systems which supposedly do not have the function is SunOS.
POSIX does not mandate its presence.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-15 22:48:34 -07:00
Lars Hjemli
a88ca34277 gitmodules(5): remove leading period from synopsis
Asciidoc treats a line starting with a period followed by a title as a
blocktitle element. My introduction of gitmodules(5) unfortunatly broke
the documentation build process due to this processing, since it made
asciidoc generate an illegal (empty) synopsis element. Removing the leading
period fixes the problem and also makes gitmodules(5) use the same synopsis
notation as gitattributes(5).

Noticed-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-15 22:46:04 -07:00
Jakub Narebski
18a936805e Generated spec file to be ignored is named git.spec and not git-core.spec
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-15 22:43:58 -07:00
Frank Lichtenheld
226bccb9ad cvsserver: Actually implement --export-all
Embarrassing bug number two in my options patch.

Also enforce that --export-all is only ever used together with an
explicit whitelist. Otherwise people might export every git repository
on the whole system without realising.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-15 22:38:48 -07:00
Frank Lichtenheld
fd1cd91e94 cvsserver: Let --base-path and pserver get along just fine
Embarassing bug number one in my options patch.

Since the code for --base-path support rewrote
the cvsroot value after comparing it with a possible
existing value (i.e. from pserver authentication)
the check always failed.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-15 22:38:45 -07:00
Eric Wong
38570a47fc git-svn: reduce stat() calls for a backwards compatibility check
Also, this fixes a bug where in an odd case a remote named
"config" could get renamed to ".metadata".

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 11:23:51 -07:00
Eric Wong
b3bf96d483 git-svn: test for creating new directories over svn://
As reported by Matthieu Moy, this is causing svnserve to
terminate connections, because it segfaults.

This test is disabled by default and can be enabled by setting
SVNSERVE_PORT to an unbound (for 127.0.0.1) TCP port in the
environment (in addition to SVN_TESTS=1).  I'm not comfortable
with having a test start a daemon by default and take up a port
that could potentially stay running if the test failed.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 11:01:49 -07:00
Eric Wong
b54a901e05 git-svn: cleanup: factor out longest_common_path() function
I hadn't looked at this code in a while and had to read this
again to figure out what it did.  To avoid having to do this
again in the future, I just gave gave the hunk a descriptive
name.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 10:56:44 -07:00
Aneesh Kumar K.V
1be846f6e4 gitview: run blame with -C -C
pass -C -C option to git-blame so that blame browsing
works when the data is copied over from other files.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 02:14:26 -07:00
Aneesh Kumar K.V
30a844874d gitview: Fix the blame interface.
The async reading from the pipe was skipping some of the
input lines. Fix the same by making sure that we add the
partial content of the previous read to the newly read
data.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 02:14:20 -07:00
Junio C Hamano
4175e9e3a8 More static
There still are quite a few symbols that ought to be static.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 02:02:10 -07:00
Junio C Hamano
b79d18c92d -Wold-style-definition fix
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 02:02:10 -07:00
Junio C Hamano
334d28ae60 Makefile: allow generating git.o for debugging purposes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 02:02:10 -07:00
Junio C Hamano
48dd1da8e1 Makefile: common-cmds.h depends on generate-cmdlist.sh script
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 02:02:10 -07:00
Jeff King
e96980ef81 builtin-add: simplify (and increase accuracy of) exclude handling
Previously, the code would always set up the excludes, and then manually
pick through the pathspec we were given, assuming that non-added but
existing paths were just ignored. This was mostly correct, but would
erroneously mark a totally empty directory as 'ignored'.

Instead, we now use the collect_ignored option of dir_struct, which
unambiguously tells us whether a path was ignored. This simplifies the
code, and means empty directories are now just not mentioned at all.

Furthermore, we now conditionally ask dir_struct to respect excludes,
depending on whether the '-f' flag has been set. This means we don't have
to pick through the result, checking for an 'ignored' flag; ignored entries
were either added or not in the first place.

We can safely get rid of the special 'ignored' flags to dir_entry, which
were not used anywhere else.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 00:41:52 -07:00
Jeff King
2abd31b078 dir_struct: add collect_ignored option
When set, this option will cause read_directory to keep
track of which entries were ignored. While this shouldn't
effect functionality in most cases, it can make warning
messages to the user much more useful.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 00:41:52 -07:00
Junio C Hamano
4234a76167 Extend --pretty=oneline to cover the first paragraph,
so that an ugly commit message like this can be
handled sanely.

Currently, --pretty=oneline and --pretty=email (hence
format-patch) take and use only the first line of the commit log
message.  This changes them to:

 - Take the first paragraph, where the definition of the first
   paragraph is "skip all blank lines from the beginning, and
   then grab everything up to the next empty line".

 - Replace all line breaks with a whitespace.

This change would not affect a well-behaved commit message that
adheres to the convention of "single line summary, a blank line,
and then body of message", as its first paragraph always
consists of a single line.  Commit messages from different
culture, such as the ones imported from CVS/SVN, can however get
chomped with the existing behaviour at the first linebreak in
the middle of sentence right now, which would become much easier
to see with this change.

The Subject: and --pretty=oneline output would become very long
and unsightly for non-conforming commits, but their messages are
already ugly anyway, and thischange at least avoids the loss of
information.

The Subject: line from a multi-line paragraph is folded using
RFC2822 line folding rules at the places where line breaks were
in the original.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 00:41:21 -07:00
Junio C Hamano
80583c0ef6 Lift 16kB limit of log message output
Traditionally we had 16kB limit when formatting log messages for
output, because it was easier to arrange for the caller to have
a reasonably big buffer and pass it down without ever worrying
about reallocating.

This changes the calling convention of pretty_print_commit() to
lift this limit.  Instead of the buffer and remaining length, it
now takes a pointer to the pointer that points at the allocated
buffer, and another pointer to the location that stores the
allocated length, and reallocates the buffer as necessary.

To support the user format, the error return of interpolate()
needed to be changed.  It used to return a bool telling "Ok the
result fits", or "Sorry, I had to truncate it".  Now it returns
0 on success, and returns the size of the buffer it wants in
order to fit the whole result.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 00:41:21 -07:00
Junio C Hamano
90ac368afd Merge branch 'jc/blame' (early part)
* 'jc/blame' (early part):
  git-blame -w: ignore whitespace
  git-blame: do not indent with spaces.
2007-06-13 00:22:40 -07:00
Jeff King
6815e56933 refactor dir_add_name
This is in preparation for keeping two entry lists in the
dir object.

This patch adds and uses the ALLOC_GROW() macro, which
implements the commonly used idiom of growing a dynamic
array using the alloc_nr function (not just in dir.c, but
everywhere).

We also move creation of a dir_entry to dir_entry_new.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 23:00:31 -07:00
Johannes Sixt
6718f1f0d0 git-remote show: Also shorten non-fast-forward refs in the 'push' listing
'git-remote show remote-name' lists the refs that are pushed to the remote
by showing the 'Push' line from the config file. But before showing it,
it shortened 'refs/heads/here:refs/heads/there' to 'here:there'. However,
if the Push line is prefixed with a plus, the ref was not shortened.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 22:26:07 -07:00