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

10733 Commits

Author SHA1 Message Date
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
733a65aa5d git-svn: allow dcommit to retain local merge information
dcommit will still rewrite the HEAD commit and the history of the first
parents of each HEAD~1, HEAD~2, HEAD~3 as it always has.

However, any merge parents (HEAD^2, HEAD^^2, HEAD~2^2) will now be
preserved when the new HEAD and HEAD~[0-9]+ commits are rewritten to SVN
with dcommit.  Commits written to SVN will still not have any merge
information besides anything in the commit message.

Thanks to Joakim Tjernlund, Junio C Hamano and Steven Grimm
for explanations, feedback, examples and test case.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 11:24:23 -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
Matthias Lederhofer
4394efecfa make git barf when an alias changes environment variables
Aliases changing environment variables (GIT_DIR or
GIT_WORK_TREE) can cause problems:
git has to use GIT_DIR to read the aliases from the config.
After running handle_options for the alias the options of the
alias may have changed environment variables.  Depending on
the implementation of setenv the memory location obtained
through getenv earlier may contain the old value or the new
value (or even be used for something else?).  To avoid these
problems git errors out if an alias uses any option which
changes environment variables.

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 23:04:14 -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
Matthias Lederhofer
9a7d941056 gitweb: change filename/directory name of snapshots
/.git or .git is removed from the project name and the
basename of the remaining path is used as the beginning of
the filename and as the directory in the archive.

The regexp will actually not strip off /.git or .git if there
wouldn't be anything left after removing it.

Currently the full project name is used as directory in the
archive and the basename is used as filename.  For example a
repository named foo/bar/.git will have a archive named
.git-<version>.* and extract to foo/bar/.git.  With this patch
the file is named bar-<version>.* and extracts to bar.

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 22:22:06 -07:00
Jim Meyering
aa32eedc69 Don't dereference a strdup-returned NULL
There are only a dozen or so uses of strdup in all of git.
Of those, most seem ok, but this one isn't:

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 22:16:29 -07:00
Junio C Hamano
c43f64a0af Merge branch 'maint'
* maint:
2007-06-12 21:05:09 -07:00
Junio C Hamano
9bfe9f80b1 Merge branch 'aw/cvs'
* aw/cvs:
  cvsimport: add <remote>/HEAD reference in separate remotes more
  cvsimport: update documentation to include separate remotes option
  cvsimport: add support for new style remote layout
2007-06-12 21:04:52 -07:00
Junio C Hamano
03545396ef Merge branch 'ep/cvstag'
* ep/cvstag:
  Use git-tag in git-cvsimport
2007-06-12 21:01:27 -07:00
Junio C Hamano
4f01d0f92d Merge branch 'ar/clone' into maint
* ar/clone:
  Fix clone to setup the origin if its name ends with .git
2007-06-12 20:48:31 -07:00
Junio C Hamano
44bdc434e8 Merge branch 'sv/objfixes' into maint
* sv/objfixes:
  Don't assume tree entries that are not dirs are blobs
2007-06-12 20:48:21 -07:00
Marius Storm-Olsen
cbae7080a7 Only use double quotes on Windows
Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
2007-06-12 15:27:52 +02:00
Simon Hausmann
d7e3868cdf Fix git-p4 rebase to detect the correct upstream branch instead of unconditionally
always rebasing on top of remotes/p4/master

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-12 14:34:46 +02:00
Simon Hausmann
27d2d8119b Moved the code from git-p4 submit to figure out the upstream branch point
into a separate helper method.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-12 14:31:59 +02:00
Lars Hjemli
891dbc6e40 Add gitmodules(5)
This adds documentation for the .gitmodules file.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 01:06:21 -07:00
Lars Hjemli
941987a554 git-submodule: give submodules proper names
This changes the way git-submodule uses .gitmodules: Subsections no longer
specify the submodule path, they now specify the submodule name. The
submodule path is found under the new key "submodule.<name>.path", which is
a required key.

With this change a submodule can be moved between different 'checkout paths'
without upsetting git-submodule.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 01:06:21 -07:00
Lars Hjemli
d57dd255a6 Rename sections from "module" to "submodule" in .gitmodules
Rename [module] to [submodule], so that it would be more
forward compatible with the proposed extension by harmonizing
the section names used in .gitmodules and .git/config.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 01:06:21 -07:00
Lars Hjemli
bf2d824660 git-submodule: remember to checkout after clone
After the initial clone of a submodule, no files would be checked out in
the submodule directory if the submodule HEAD was equal to the SHA-1
specified in the index of the containing repository. This fixes the problem
by simply ignoring submodule HEAD for a fresh clone.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 01:06:21 -07:00
Lars Hjemli
b10ee7606e t7400: barf if git-submodule removes or replaces a file
The test for an unmolested file wouldn't fail properly if the file had been
removed or replaced by something other than a regular file. This fixes it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 01:06:21 -07:00
Johannes Schindelin
ca6c097089 Teach diff to imply --find-copies-harder upon -C -C
Earlier, a second "-C" on the command line had no effect.
But "--find-copies-harder" is so long to type, let's make doubled -C
enable that option.  It is in line with how "git blame" handles such
doubled options to mean "work harder".

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 01:00:38 -07:00
Johannes Sixt
d52fd42acd Remove trailing slash from $(template_dir).
All the other directory location variables do not have the trailing
slash.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 00:23:31 -07:00
Johannes Sixt
9354768ab7 Avoid double-slash in path names that depend on $(sharedir).
Recent git-gui has the ability to determine the location of its library
files relative to the --exec-dir. Its Makefile enables this capability
depending on the install paths that are specified. However, without this
fix there is an extra slash in a path specification, so that the Makefile
does not recognize the equivalence of two paths that it compares.

A side-effect is that all "standard" builds (which do not set $(sharedir)
explicitly) now exploit above mentioned gut-gui feature.

Another side-effect is that an ugly compiled-in double-slash in
$(template_dir) is avoided.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 00:23:31 -07:00
Junio C Hamano
30ba3809a4 Merge branch 'lh/submodule'
* lh/submodule:
  git-submodule: clone during update, not during init
  git-submodule: move cloning into a separate function
2007-06-12 00:17:26 -07:00
Junio C Hamano
f26cacf495 Merge branch 'maint'
* maint:
  Unquote From line from patch before comparing with given from address.
  git-cherry: Document 'limit' command-line option
2007-06-12 00:15:16 -07:00
Junio C Hamano
1924d64f6e Merge branch 'master' of git://repo.or.cz/git-gui
* 'master' of git://repo.or.cz/git-gui:
  git-gui: Save geometry before the window layout is damaged
  git-gui: Give amend precedence to HEAD over MERGE_MSG
  git-gui: Include 'war on whitespace' fixes from git.git
2007-06-12 00:14:47 -07:00
Kristian Høgsberg
2cf69cf6ed Unquote From line from patch before comparing with given from address.
This makes --suppress-from actually work when you're unfortunate enough
to have non-ASCII in your name.  Also, if there's a match use the optionally
RFC2047 quoted version from the email.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 00:13:49 -07:00
Luiz Fernando N. Capitulino
6894f49f7b git-cherry: Document 'limit' command-line option
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-12 00:13:20 -07:00