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

11787 Commits

Author SHA1 Message Date
Junio C Hamano
3a229177f9 Merge branch 'ss/svnimport'
* ss/svnimport:
  Fix pool handling in git-svnimport to avoid memory leaks.
2007-09-29 16:44:25 -07:00
Junio C Hamano
6b4790db24 Merge branch 'sv/svn'
* sv/svn:
  git-svn: handle changed svn command-line syntax
  git-svn: fix test for trunk svn (transaction out of date)
  git-svn: fix test for trunk svn (commit message not needed)
2007-09-29 16:43:23 -07:00
Junio C Hamano
2a350d7a68 Merge branch 'ml/submodule'
* ml/submodule:
  git-submodule - allow a relative path as the subproject url
2007-09-29 16:43:10 -07:00
Junio C Hamano
471fa1ecd5 Merge branch 'jb/remote-rm'
* jb/remote-rm:
  git-remote rm: add tests and minor fix-ups
  remote: document the 'rm' subcommand
  remote: add 'rm' subcommand
2007-09-29 16:43:06 -07:00
Junio C Hamano
ff08c373dc Merge branch 'jk/diff-rename'
* jk/diff-rename:
  diffcore-rename: cache file deltas
2007-09-29 16:42:50 -07:00
Junio C Hamano
d7da5597a8 Sync with GIT 1.5.3.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29 16:31:40 -07:00
Junio C Hamano
552ce11006 GIT 1.5.3.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.5.3.3
2007-09-29 16:07:46 -07:00
Linus Torvalds
b7bb760d5e Fix revision log diff setup, avoid unnecessary diff generation
We used to incorrectly start calculating diffs whenever any argument but
'-z' was recognized by the diff options parsing. That was bogus, since not
all arguments result in diffs being needed, so we just waste a lot of time
and effort on calculating diffs that don't matter.

This actually also fixes another bug in "git log". Try this:

	git log -C

and notice how it prints an extra empty line in between log entries, even
though it never prints the actual diff (because we didn't ask for any diff
format, so the diff machinery never prints anything).

With this patch, that bogus empty line is gone, because "revs->diff" is
never set.  So this isn't just a "wasted time and effort" issue, it's also
a slight semantic fix.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29 15:42:32 -07:00
Miklos Vajna
ee8245b54a git-bundle: fix commandline examples in the manpage
Multiple commands were displayed in one line, making the manpage hard to read.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29 15:40:17 -07:00
Junio C Hamano
d3759c0805 Merge branch 'mergetool' of git://repo.or.cz/git/mergetool into maint
* 'mergetool' of git://repo.or.cz/git/mergetool:
  mergetool: Fix typo in options passed to kdiff3
  mergetool: fix emerge when running in a subdirectory
  Mergetool generating blank files (1.5.3)
2007-09-29 15:39:39 -07:00
Pierre Habouzit
b315c5c081 strbuf change: be sure ->buf is never ever NULL.
For that purpose, the ->buf is always initialized with a char * buf living
in the strbuf module. It is made a char * so that we can sloppily accept
things that perform: sb->buf[0] = '\0', and because you can't pass "" as an
initializer for ->buf without making gcc unhappy for very good reasons.

strbuf_init/_detach/_grow have been fixed to trust ->alloc and not ->buf
anymore.

as a consequence strbuf_detach is _mandatory_ to detach a buffer, copying
->buf isn't an option anymore, if ->buf is going to escape from the scope,
and eventually be free'd.

API changes:
  * strbuf_setlen now always works, so just make strbuf_reset a convenience
    macro.
  * strbuf_detatch takes a size_t* optional argument (meaning it can be
    NULL) to copy the buffer's len, as it was needed for this refactor to
    make the code more readable, and working like the callers.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29 02:13:33 -07:00
Pierre Habouzit
690b61f5f1 double free in builtin-update-index.c
path_name is either ptr that should not be freed, or a pointer to a strbuf
buffer that is deallocated when exiting the loop. Don't do that !

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29 01:40:19 -07:00
Theodore Ts'o
208fe3ac7e mergetool: Fix typo in options passed to kdiff3
Fix missing double hyphens in "-L1" and "-L2"

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-09-28 22:26:05 -04:00
Theodore Ts'o
f6e0e55934 mergetool: fix emerge when running in a subdirectory
Only pass the basename of the output filename when to emerge, since
emerge interprets non-absolute pathnames relative to the containing
directory of the output buffer.

Thanks to Kelvie Wong for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-09-28 21:23:22 -04:00
Junio C Hamano
769f39861b Mergetool generating blank files (1.5.3)
When mergetool is run from a subdirectory, "ls-files -u" nicely
limits the output to conflicted files in that directory, but
we need to give the full path to cat-file plumbing to grab the
contents of stages.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-09-28 20:13:14 -04:00
Dan Nicholson
9f569fe58f quiltimport: Skip non-existent patches
When quiltimport encounters a non-existent patch in the series file,
just skip to the next patch. This matches the behavior of quilt.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-27 16:19:19 -07:00
Kristian Høgsberg
6d69b6f6ac Clean up stripspace a bit, use strbuf even more.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-27 00:33:33 -07:00
Kristian Høgsberg
a9390b9fce Add strbuf_read_file().
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-27 00:33:29 -07:00
Junio C Hamano
b4833a2c62 rerere: Fix use of an empty strbuf.buf
The code incorrectly assumed that strbuf.buf is always an
allocated piece of memory that has NUL at offset strbuf.len.
That assumption does not hold for a freshly initialized empty
strbuf.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 23:34:01 -07:00
Johannes Schindelin
26b2800768 apply: get rid of --index-info in favor of --build-fake-ancestor
git-am used "git apply -z --index-info" to find the original versions
of the files touched by the diff, to be able to do an inexpensive
three-way merge.

This operation makes only sense in a repository, since the index
information in the diff refers to blobs, which have to be present in
the current repository.

Therefore, teach "git apply" a mode to write out the result as an
index file to begin with, obviating the need for scripts to do it
themselves.

The sole user for --index-info is "git am" is converted to
use --build-fake-ancestor in this patch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 13:42:10 -07:00
Carlos Rica
102c2338da Move make_cache_entry() from merge-recursive.c into read-cache.c
The function make_cache_entry() is too useful to be hidden away in
merge-recursive.  So move it to libgit.a (exposing it via cache.h).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 13:42:10 -07:00
Junio C Hamano
44b2476a12 send-email --smtp-server-port: allow overriding the default port
You can use --smtp-server-port option to specify a port
different from the default (typically, SMTP servers listen
to smtp port 25 and ssmtp port 465).

Users should be aware that sending auth info over non-ssl
connections may be unsafe or just may not work at all
depending on SMTP server config.

Signed-off-by: Glenn Rempe <glenn@rempe.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 13:27:45 -07:00
Pierre Habouzit
1dffb8fa80 Small cache_tree_write refactor.
This function cannot fail, make it void. Also make write_one act on a
const char* instead of a char*.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 02:27:06 -07:00
Pierre Habouzit
8289b62095 Make builtin-rerere use of strbuf nicer and more efficient.
memory is now reused across hunks.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 02:27:05 -07:00
Pierre Habouzit
45f66f6463 Add strbuf_cmp.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 02:27:05 -07:00
Junio C Hamano
a8f3e2219c strbuf_setlen(): do not barf on setting length of an empty buffer to 0
strbuf_setlen() expect to be able to NUL terminate the buffer,
but a completely empty strbuf could have an empty buffer with 0
allocation; both the assert() and the assignment for NUL
termination would fail.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 02:27:05 -07:00
Johannes Schindelin
73697a0b57 rebase -i: work on a detached HEAD
Earlier, rebase -i refused to rebase a detached HEAD.  Now it no longer
does.

Incidentally, this fixes "git gc --auto" shadowing the true exit status.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 00:42:17 -07:00
Junio C Hamano
61ab92df40 Merge branch 'jc/autogc' into js/rebase-i
* jc/autogc:
  git-gc --auto: run "repack -A -d -l" as necessary.
  git-gc --auto: restructure the way "repack" command line is built.
  git-gc --auto: protect ourselves from accumulated cruft
  git-gc --auto: add documentation.
  git-gc --auto: move threshold check to need_to_gc() function.
  repack -A -d: use --keep-unreachable when repacking
  pack-objects --keep-unreachable
  Export matches_pack_name() and fix its return value
  Invoke "git gc --auto" from commit, merge, am and rebase.
  Implement git gc --auto

Conflicts:

	builtin-pack-objects.c
2007-09-26 00:42:12 -07:00
Michal Vitecek
55246aac67 Don't use "<unknown>" for placeholders and suppress printing of empty user formats.
This changes the interporate() to replace entries with NULL values
by the empty string, and uses it to interpolate missing fields in
custom format output used in git-log and friends.  It is most useful
to avoid <unknown> output from %b format for a commit log message
that lack any body text.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 00:40:47 -07:00
Jeff King
a5a3878ba7 diffcore-rename: cache file deltas
We find rename candidates by computing a fingerprint hash of
each file, and then comparing those fingerprints. There are
inherently O(n^2) comparisons, so it pays in CPU time to
hoist the (rather expensive) computation of the fingerprint
out of that loop (or to cache it once we have computed it once).

Previously, we didn't keep the filespec information around
because then we had the potential to consume a great deal of
memory. However, instead of keeping all of the filespec
data, we can instead just keep the fingerprint.

This patch implements and uses diff_free_filespec_data_large
to accomplish that goal. We also have to change
estimate_similarity not to needlessly repopulate the
filespec data when we already have the hash.

Practical tests showed 4.5x speedup for a 10% memory usage
increase.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 00:40:32 -07:00
Matt Kraai
5166810b1e rebase -i: create .dotest-merge after validating options.
Creating .dotest-merge before validating the options prevents both
--continue and --interactive from working if the options are invalid,
so only create it after validating the options.

[jc: however, just moving the creation of DOTEST breaks output]

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 00:39:09 -07:00
Randy Dunlap
bce92405ae core-tutorial: correct URL
The tinyurl is incorrect -- it attempts to go to groups.osdl.org,
which is gone.  Either use the full URL (in patch) or create a new
tinyurl for this URL.

Is the web page (where I first saw this problem) generated from
this txt file?
http://www.kernel.org/pub/software/scm/git/docs/core-tutorial.html
If not, it needs to be updated also.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 23:39:01 -07:00
Shawn Bohrer
b06743925c Fix spelling of overridden in documentation
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 23:38:42 -07:00
Johannes Schindelin
ae830ed7f5 rebase -i: avoid exporting GIT_AUTHOR_* variables
It is somewhat unsafe to export the GIT_AUTHOR_* variables, since a later
call to git-commit or git-merge could pick them up inadvertently.

So avoid the export, using a recipe provided by Johannes Sixt.

Incidentally, this fixes authorship of merges with "rebase --preserve -i".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 17:49:40 -07:00
Johannes Schindelin
dad4e32c46 rebase -i: Fix numbers in progress report
Instead of counting all lines in done and todo, we now count the actions
before outputting "$Rebasing ($count/$total)".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 17:46:54 -07:00
Johannes Schindelin
376ccb8cbb rebase -i: style fixes and minor cleanups
This patch indents ";;" consistently with the rest of git's shell scripts,
and makes sure that ";;" are before each "esac".

It introduces a helper function "has_action", to make it easier to read
the intentions of the code.

Errors from "git rev-parse --verify" are no longer ignored.

Spaces are quoted using single quotes instead of a backslash, for
readability.

A "test $preserve=f" (missing spaces) was fixed; hashes are no longer
written to "$DOTEST"/rewritten/ unnecessarily.

We used to quote the message for a squash, only to have "echo" unquote it.
Now we use "printf" and do not need to quote to start with.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 17:46:50 -07:00
Johannes Schindelin
be6ff208d8 rebase -i: commit when continuing after "edit"
When doing an "edit" on a commit, editing and git-adding some files,
"git rebase -i" complained about a missing "author-script".  The idea was
that the user would call "git commit --amend" herself.

But we can be nice and do that for the user.

Noticed by Dmitry Potapov.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 17:46:43 -07:00
Johannes Sixt
4d84aff356 gitattributes.txt: Be more to the point in the filter driver description.
The description was meant to emphasizes that the project should remain
usable even if the filter driver was not used. This makes it more explicit
and removes the "here is rope to hang yourself" paraphrase.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 17:37:35 -07:00
Johannes Sixt
2dbbc45730 gitattributes.txt: Remove a duplicated paragraph about 'ident' and 'crlf' interaction.
The order in which 'ident' and 'crlf' are carried out is documented a few paragraphs
later again, after 'filter' was introduced.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 17:37:31 -07:00
Lars Hjemli
df3a02f612 Make merge-recursive honor diff.renamelimit
It might be a sign of source code management gone bad, but when two branches
has diverged almost beyond recognition and time has come for the branches to
merge, the user is going to need all the help his tool can give him. Honoring
diff.renamelimit has great potential as a painkiller in such situations.

The painkiller effect could have been achieved by e.g. 'merge.renamelimit',
but the flexibility gained by a separate option is questionable: our user
would probably expect git to detect renames equally good when merging as
when diffing (I known I did).

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 17:35:16 -07:00
Matt Kraai
2ecb5ea2ad Move convert-objects to contrib.
convert-objects was needed to convert from an old-style repository,
which hashed the compressed contents and used a different date format.
Such repositories are presumably no longer common and, if such
conversions are necessary, should be done by writing a frontend for
git-fast-import.

Linus, the original author, is OK with moving it to contrib.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 17:34:12 -07:00
Michael Smith
6dd14366d9 user-manual: Explain what submodules are good for.
Rework the introduction to the Submodules section to explain why
someone would use them, and fix up submodule references from the
tree-object and todo sections.

Signed-off-by: Michael Smith <msmith@cbnco.com>
Acked-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 17:30:12 -07:00
Junio C Hamano
d3f3ab264f Merge branch 'jn/web' into maint
* jn/web:
  gitweb: No difftree output for trivial merge
  gitweb: Remove parse_from_to_diffinfo code from git_patchset_body
2007-09-25 15:17:22 -07:00
Mark Levedahl
f31a522a2d git-submodule - allow a relative path as the subproject url
This allows a subproject's location to be specified and stored as relative
to the parent project's location (e.g., ./foo, or ../foo). This url is
stored in .gitmodules as given. It is resolved into an absolute url by
appending it to the parent project's url when the information is written
to .git/config (i.e., during submodule add for the originator, and
submodule init for a downstream recipient). This allows cloning of the
project to work "as expected" if the project is hosted on a different
server than when the subprojects were added.

Signed-off-by: Mark Levedahl <mdl123@verizon.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 00:31:12 -07:00
Junio C Hamano
41ef95aea7 Merge branch 'maint'
* maint:
  Do not over-quote the -f envelopesender value.
  unexpected Make output (e.g. from --debug) causes build failure
  Fixed minor typo in t/t9001-send-email.sh test command line.
2007-09-25 00:30:33 -07:00
Jim Meyering
d1637a07f6 Do not over-quote the -f envelopesender value.
Without this, the value passed to sendmail would have an extra set of
single quotes.  At least exim's sendmail emulation would object to that:

    exim: bad -f address "'list-addr@example.org'": malformed address: ' \
      may not follow 'list-addr@example.org
    error: hooks/post-receive exited with error code 1

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 00:30:19 -07:00
Jim Meyering
e883932f7d unexpected Make output (e.g. from --debug) causes build failure
Without this, the extra output produced e.g., by "make --debug"
would go into $INSTLIBDIR and then cause the sed command to fail.

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25 00:30:16 -07:00
Shawn O. Pearce
4491e62ae9 Prevent send-pack from segfaulting when a branch doesn't match
If `git push url foo` can't find a local branch named foo we can't
match it to any remote branch as the local branch is NULL and its
name is probably at position 0x34 in memory.  On most systems that
isn't a valid address for git-send-pack's virtual address space
and we segfault.

If we can't find a source match and we have no destination we
need to abort the match function early before we try to match the
destination against the remote.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-24 23:25:26 -07:00
Shawn O. Pearce
7dfee372b0 Cleanup unnecessary break in remote.c
This simple change makes the body of "case 0" easier to read; no
matter what the value of matched_src is we want to break out of
the switch and not fall through.  We only want to display an error
if matched_src is NULL, as this indicates there is no local branch
matching the input.

Also modified the default case's error message so it uses one less
line of text.  Even at 8 column per tab indentation we still don't
break 80 columns with this new formatting.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-24 23:25:19 -07:00
Shawn O. Pearce
009c5bcd24 Cleanup style nit of 'x == NULL' in remote.c
Git style tends to prefer "!x" over "x == NULL".  Make it so in
these handful of locations that were not following along.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-24 23:25:15 -07:00