1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-06 01:03:02 +01:00
Commit graph

8988 commits

Author SHA1 Message Date
Junio C Hamano
c379c4b176 Merge branch 'maint'
* maint:
  cvsserver: asciidoc formatting changes
2007-03-14 01:38:39 -07:00
Junio C Hamano
36db2399e0 Merge branch 'pb/branch-track'
* pb/branch-track:
  Fix broken create_branch() in builtin-branch.
  git-branch, git-checkout: autosetup for remote branch tracking
2007-03-14 01:38:28 -07:00
Jim Meyering
09f2825147 git-grep: don't use sscanf
If you use scanf or sscanf to parse integers, your code probably
accepts bogus inputs.  For example, builtin-grep (aka git-grep) uses
sscanf(scan, "%u", &num) to parse the integer argument to -A, -B, -C.
Currently, "-C 1,000" and "-C 4294967297" are both treated just like
"-C 1":

    $ git-grep -h -C 4294967297 juggle
    out and you may find it easier to switch back and forth if you
    juggle multiple lines of development simultaneously. Of
    course, you will pay the price of more disk usage to hold

The obvious fix is to use strtoul instead.  But using a bare strtoul is
too messy, at least when done properly, so I've added a wrapper function.

The new function in the patch below belongs elsewhere if it would be
useful in replacing any of the four remaining uses of sscanf.

One final note:  With this change, I get a slightly different
diagnostic depending on the context size:

  $ ./git-grep -h -C 4294967296 juggle
  fatal: 4294967296: invalid context length argument
  [Exit 128]
  $ ./git-grep -h -C 4294967295 juggle
  grep: 4294967295: invalid context length argument

  [Exit 1]

A common convention that makes it easy to identify the source
of a diagnostic is to include the program name before the first ":".
Whether that should be "git" or "git-grep" is another question.
Using "grep" or "fatal" is misleading.

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-14 01:37:50 -07:00
Johannes Schindelin
6cd7895fee Do not output "GEN " when generating perl.mak
This fixes the same issue as 8bef6204, which became an issue again
after 31d0399c.

Besides, it is not really helpful to print just "GEN " (_without_
"perl.mak").

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-14 01:33:49 -07:00
Junio C Hamano
0497c620ca shortlog: prompt when reading from terminal by mistake
I was trying to see who have been active recently to find GSoC
mentor candidates by running:

	$ git shortlog -s -n --since=4.months | head -n 20

After waiting for about 20 seconds, I started getting worried,
thinking that the recent revision traversal updates might have
had an unintended side effect.

Not so.  "git shortlog" acts as a filter when no revs are given,
unlike "git log" which defaults to HEAD.  It was reading from
its standard input.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-14 01:33:41 -07:00
Junio C Hamano
86952cdabd Documentation: add git-mergetool to the command list.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-14 01:29:26 -07:00
Junio C Hamano
4739cea566 Merge branch 'master' of git://repo.or.cz/git/mergetool
* 'master' of git://repo.or.cz/git/mergetool:
  Add git-mergetool to run an appropriate merge conflict resolution program
2007-03-14 01:13:39 -07:00
Eric Wong
dee41f3e55 git-svn: add -l/--local command to "git svn rebase"
This avoids fetching new revisions remotely, and is usefuly
versus plain "git rebase" because the user does not have to
specify which remote head to rebase against.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-13 21:18:37 -07:00
Frank Lichtenheld
ad0f8c9ea7 cvsserver: asciidoc formatting changes
Format some lists really as lists. Improves both html and man
output.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-13 21:16:05 -07:00
Theodore Ts'o
c4b4a5af16 Add git-mergetool to run an appropriate merge conflict resolution program
The git-mergetool program can be used to automatically run an appropriate
merge resolution program to resolve merge conflicts.  It will automatically
run one of kdiff3, tkdiff, meld, xxdiff, or emacs emerge programs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-03-13 20:14:05 -04:00
Junio C Hamano
27ebd6e044 Merge branch 'master' of git://repo.or.cz/git-gui
* 'master' of git://repo.or.cz/git-gui:
  git-gui: Support of "make -s" in: do not output anything of the build itself
2007-03-12 23:14:07 -07:00
Junio C Hamano
9550a9cea9 Merge branch 'maint'
* maint:
  Don't package the git-gui credits file anymore
  git-gui: Allow 'git gui version' outside of a repository
  git-gui: Revert "git-gui: Display all authors of git-gui."
  git-gui: Revert "Don't modify CREDITS-FILE if it hasn't changed."
  git-gui: Allow committing empty merges
2007-03-12 23:13:01 -07:00
Junio C Hamano
f8a066581d Merge branch 'master' of git://repo.or.cz/git/fastimport
* 'master' of git://repo.or.cz/git/fastimport:
  Remove unnecessary casts from fast-import
  New fast-import test case for valid tree sorting
  fast-import: grow tree storage more aggressively
2007-03-12 23:10:23 -07:00
Junio C Hamano
65d61e5f51 Merge branch 'maint' of git://repo.or.cz/git/fastimport into maint
* 'maint' of git://repo.or.cz/git/fastimport:
  fast-import: grow tree storage more aggressively
2007-03-12 23:08:27 -07:00
Shawn O. Pearce
6016e35bc1 Fix t5510-fetch's use of sed
POSIX says sed may add a trailing LF if there isn't already
one there.  We shouldn't rely on it not adding that LF, as
some systems (Mac OS X for example) will add it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12 17:37:30 -07:00
Shawn O. Pearce
9dc09c7664 Simplify closing two fds at once in run-command.c
I started hacking on a change to add stdout redirection support to
the run_command family, but found I was using a lot of close calls
on two pipes in an array (such as for pipe).  So I'm doing a tiny
bit of refactoring first to make the next set of changes clearer.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12 16:31:35 -07:00
Shawn O. Pearce
061e35c581 Remove unnecessary casts from fast-import
Jeff King pointed out that these casts are quite unnecessary, as
the compiler should be doing them anyway, and may cause problems
in the future if the size of the argument for to_atom were to ever
be increased.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-03-12 15:48:37 -04:00
Shawn O. Pearce
7f09ac4714 Merge branch 'maint'
* maint:
  fast-import: grow tree storage more aggressively
2007-03-12 15:04:46 -04:00
Jeff King
e741130386 New fast-import test case for valid tree sorting
The Git tree sorting convention is more complex than just the name,
it needs to include the mode too to make sure trees sort as though
their name ends with "/".

This is a simple test case that verifies fast-import keeps the tree
ordering correct after editing the same tree twice in a single
input stream.  A recent proposed patch series (that has not yet
been applied) will cause this test to fail, due to a bug in the
way the series handles sorting within the trees.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-03-12 15:02:13 -04:00
Jeff King
f022f85f6d fast-import: grow tree storage more aggressively
When building up a tree for a commit, fast-import
dynamically allocates memory for the tree entries. When more
space is needed, the allocated memory is increased by a
constant amount. For very large trees, this means
re-allocating and memcpy()ing the memory O(n) times.

To compound this problem, releasing the previous tree
resource does not free the memory; it is kept in a pool
for future trees. This means that each of the O(n)
allocations will consume increasing amounts of memory,
giving O(n^2) memory consumption.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-03-12 15:01:44 -04:00
Shawn O. Pearce
115f0fe499 Don't package the git-gui credits file anymore
Since git-gui 0.6.4 the credits file is no longer produced.
This file was removed from git-gui due to build issues that
a lot of users and Git developers have reported running into.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12 11:44:46 -07:00
Junio C Hamano
3ed02de2f4 Merge branch 'maint' of git://repo.or.cz/git-gui into maint
* 'maint' of git://repo.or.cz/git-gui:
  git-gui: Allow 'git gui version' outside of a repository
  git-gui: Revert "git-gui: Display all authors of git-gui."
  git-gui: Revert "Don't modify CREDITS-FILE if it hasn't changed."
  git-gui: Allow committing empty merges
2007-03-12 11:43:22 -07:00
Linus Torvalds
1358e7d670 Re-fix get_sha1_oneline()
What the function wants to return is not if we saw any return
from pop_most_recent_commit(), but if we found what was asked
for.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12 11:30:38 -07:00
Shawn O. Pearce
2ec0cb7959 Merge branch 'maint'
* maint:
  git-gui: Allow 'git gui version' outside of a repository
  git-gui: Revert "git-gui: Display all authors of git-gui."
  git-gui: Revert "Don't modify CREDITS-FILE if it hasn't changed."
  git-gui: Allow committing empty merges
2007-03-12 13:26:59 -04:00
Shawn O. Pearce
756d846fea git-gui: Allow 'git gui version' outside of a repository
I got a little surprise one day when I tried to run 'git gui version'
outside of a Git repository to determine what version of git-gui was
installed on that system.  Turns out we were doing the repository
check long before we got around to command line argument handling.

We now look to see if the only argument we have been given is
'version' or '--version', and if so, print out the version and
exit immediately; long before we consider looking at the Git
version or working directory.  This way users can still get to
the git-gui version number even if Git's version cannot be read.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-03-12 13:26:06 -04:00
Shawn O. Pearce
bb616ddd15 git-gui: Revert "git-gui: Display all authors of git-gui."
This reverts commit 871f4c97ad.

Too many users have complained about the credits generator in
git-gui, so I'm backing the entire thing out.  This revert will
finish that series.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-03-12 13:26:04 -04:00
Shawn O. Pearce
56a7fde16e git-gui: Revert "Don't modify CREDITS-FILE if it hasn't changed."
This reverts commit 92446aba47.

Too many users have complained about the credits generator in
git-gui, so I'm backing the entire thing out.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-03-12 13:25:58 -04:00
Shawn O. Pearce
c7bafad10d git-gui: Allow committing empty merges
Johannes Sixt noticed that git-gui would not let the user commit
a merge created by `git merge -s ours` as the ours strategy does
not alter the tree (that is HEAD^1^{tree} = HEAD^{tree} after the
merge).  The same issue arises from amending such a merge commit.

We now permit an empty commit (no changed files) if we are doing
a merge commit.  Core Git does this with its command line based
git-commit tool, so it makes sense for the GUI to do the same.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-03-12 13:03:47 -04:00
Johannes Schindelin
34572ed2c8 git-bundle: only die if pack would be empty, warn if ref is skipped
A use case for git-bundle expected to be quite common is this:

	$ git bundle create daily.bundle --since=10.days.ago --all

The expected outcome is _not_ to error out if only a couple of the
refs were not changed during the last 10 days.

This patch complains loudly about refs which are skipped due to the
pack not containing the corresponding objects, but dies only if
no objects would be in the pack _at all_.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 23:55:46 -07:00
Avi Kivity
4a62d3f5b2 git-send-email: configurable bcc and chain-reply-to
Chain-reply-to is a personal perference, and is unlikely to change from
patchset to patchset.  Similarly, bcc is likely to have the same values
every invocation is one likes to bcc oneself.

So, allow both to be set via configuration variables.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 23:53:57 -07:00
Junio C Hamano
240c77c714 Merge branch 'maint'
* maint:
  git-send-email: Document configuration options
  git-merge: warn when -m provided on a fast forward
2007-03-11 23:53:52 -07:00
Avi Kivity
fc095242b1 git-send-email: Document configuration options
Wishing to implement an email aliases file, I found that they were already
implmented.  Document them for the next user.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 23:52:03 -07:00
J. Bruce Fields
be242d576c git-merge: warn when -m provided on a fast forward
Warn the user that the "-m" option is ignored in the case of a fast
forward.  That may save some confusion in the case where the user
doesn't know about fast forwards yet and may not realize that the
behavior here is intentional.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 23:49:20 -07:00
Junio C Hamano
2422f1ca3b Merge branch 'jc/boundary'
* jc/boundary:
  git-bundle: prevent overwriting existing bundles
  git-bundle: die if a given ref is not included in bundle
  git-bundle: handle thin packs in subcommand "unbundle"
  git-bundle: Make thin packs
  git-bundle: avoid packing objects which are in the prerequisites
  bundle: fix wrong check of read_header()'s return value & add tests
  revision --boundary: fix uncounted case.
  revision --boundary: fix stupid typo
  git-bundle: make verify a bit more chatty.
  revision traversal: SHOWN means shown
  git-bundle: various fixups
  revision traversal: retire BOUNDARY_SHOW
  revision walker: Fix --boundary when limited
2007-03-11 23:02:52 -07:00
Shawn O. Pearce
f43cd49fb8 Change {pre,post}-receive hooks to use stdin
Sergey Vlasov, Andy Parkins and Alex Riesen all pointed out that it
is possible for a single invocation of receive-pack to be given more
refs than the OS might allow us to pass as command line parameters
to a single hook invocation.

We don't want to break these up into multiple invocations (like
xargs might do) as that makes it impossible for the pre-receive
hook to verify multiple related ref updates occur at the same time,
and it makes it harder for post-receive to send out a single batch
notification.

Instead we pass the reference data on a pipe connected to the
hook's stdin, supplying one ref per line to the hook.  This way a
single hook invocation can obtain an infinite amount of ref data,
without bumping into any operating system limits.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 22:56:03 -07:00
Shawn O. Pearce
1d9e8b56fe Split back out update_hook handling in receive-pack
Since we have decided to change the calling conventions for the
pre-receive and post-receive hooks to take the ref data on stdin
rather than on the command line we cannot use the same logic to
invoke the update hook anymore.

So we take a small step backwards towards what we used to have,
and create a specialized function for executing just the update
hook.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 22:49:46 -07:00
Shawn O. Pearce
6c319a22e4 Refactor run_command error handling in receive-pack
I'm pulling the error handling used to decode the result of
run_command up into a new function so that I can reuse it.
No changes, just a simple code movement.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 22:49:43 -07:00
Shawn O. Pearce
4919bf0354 Teach run_command how to setup a stdin pipe
Sometimes callers trying to use run_command to execute a child
process will want to setup a pipe or file descriptor to redirect
into the child's stdin.

This idea is completely stolen from builtin-bundle's fork_with_pipe,
written by Johannes Schindelin.  All credit (and blame) should lie
with Dscho.  ;-)

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 22:49:40 -07:00
Shawn O. Pearce
ebcb5d16ca Split run_command into two halves (start/finish)
If the calling process wants to send data to stdin of a
child process it will need to arrange for a pipe and get
the child process running, feed data to it, then wait
for the child process to finish.  So we split the run
function into two halves, allowing callers to first
start the child then later finish it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 22:49:37 -07:00
Shawn O. Pearce
f1000898d4 Start defining a more sophisticated run_command
There are a number of places where we do some variation of
fork()+exec() but we also need to setup redirection in the process,
much like what run_command does for us already with its option flags.

It would be nice to reuse more of the run_command logic, especially
as that non-fork API helps us to port to odd platforms like Win32.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 22:49:34 -07:00
Shawn O. Pearce
afdb269c76 Remove unused run_command variants
We don't actually use these va_list based variants of run_command
anymore.  I'm removing them before I make further improvements.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 22:49:31 -07:00
Shawn O. Pearce
497bdc88d6 Switch to run_command_v_opt in revert
Another change by me is removing the va_list variants of run_command,
one of which is used by builtin-revert.c.  To avoid compile errors
I'm refactoring builtin-revert to use the char** variant instead,
as that variant is staying.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 22:49:25 -07:00
Frank Lichtenheld
538778469c cvsserver: Use Merged response instead of Update-existing for merged files
Using Update-existing leads to the client forgetting about the "locally
modified" status of the file which can lead to loss of local changes on
later updates.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Acked-by: Martin Langhoff <martin.langhoff@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 22:49:08 -07:00
Jim Meyering
ed8ad7e2e2 I like the idea of the new ':/<oneline prefix>' notation, and gave it
a try, but all I could get was a segfault.  It was dereferencing a NULL
commit list.  Fix below.  With it, this example now works:

    $ mkdir .j; cd .j; touch f
    $ git-init; git-add f; git-commit -mc f; echo x >f; git-commit -md f
    $ git-diff -p :/c :/d
    diff --git a/f b/f
    index e69de29..587be6b 100644
    --- a/f
    +++ b/f
    @@ -0,0 +1 @@
    +x

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11 13:28:13 -07:00
Junio C Hamano
45994a1e33 Fix broken create_branch() in builtin-branch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-10 23:41:58 -08:00
Paolo Bonzini
0746d19a82 git-branch, git-checkout: autosetup for remote branch tracking
In order to track and build on top of a branch 'topic' you track from
your upstream repository, you often would end up doing this sequence:

  git checkout -b mytopic origin/topic
  git config --add branch.mytopic.remote origin
  git config --add branch.mytopic.merge refs/heads/topic

This would first fork your own 'mytopic' branch from the 'topic'
branch you track from the 'origin' repository; then it would set up two
configuration variables so that 'git pull' without parameters does the
right thing while you are on your own 'mytopic' branch.

This commit adds a --track option to git-branch, so that "git
branch --track mytopic origin/topic" performs the latter two actions
when creating your 'mytopic' branch.

If the configuration variable branch.autosetupmerge is set to true, you
do not have to pass the --track option explicitly; further patches in
this series allow setting the variable with a "git remote add" option.
The configuration variable is off by default, and there is a --no-track
option to countermand it even if the variable is set.

Signed-off-by: Paolo Bonzini  <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-10 23:41:58 -08:00
Junio C Hamano
8a3fbdd9e6 Merge branch 'js/attach'
* js/attach:
  format-patch --attach: not folding some long headers.
  format-patch: add --inline option and make --attach a true attachment
2007-03-10 23:38:18 -08:00
Junio C Hamano
cf6981d493 Merge branch 'js/diff-ni'
* js/diff-ni:
  Get rid of the dependency to GNU diff in the tests
  diff --no-index: support /dev/null as filename
  diff-ni: fix the diff with standard input
  diff: support reading a file from stdin via "-"
2007-03-10 23:26:33 -08:00
Junio C Hamano
8509fed75d Merge branch 'jc/fsck'
* jc/fsck:
  fsck: exit with non-zero status upon errors
  unpack_sha1_file(): detect corrupt loose object files.
  fsck: fix broken loose object check.
2007-03-10 23:10:26 -08:00
Junio C Hamano
ce4474b65d Merge branch 'pb/commit-i'
* pb/commit-i:
  git-commit: add a --interactive option
2007-03-10 23:00:38 -08:00