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

13771 Commits

Author SHA1 Message Date
Charles Bailey
bbdfbc4b01 git-mergetool documentaiton: show toolnames in typewriter font
Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-08 13:22:55 -08:00
Junio C Hamano
5c9afcff1a Merge branch 'aw/maint-shortlog-blank-lines'
* aw/maint-shortlog-blank-lines:
  shortlog: take the first populated line of the description
2008-03-08 02:23:42 -08:00
Junio C Hamano
60e3cad92e Merge branch 'maint'
* maint:
  unquote_c_style: fix off-by-one.
  test-lib: fix TERM to dumb for test repeatability
  config.txt: refer to --upload-pack and --receive-pack instead of --exec
  git-gui: Gracefully fall back to po2msg.sh if msgfmt --tcl fails
2008-03-07 22:43:46 -08:00
Junio C Hamano
ba51795c5f send-email: --no-signed-off-cc should suppress 'sob' cc
The logic to countermand suppression of Cc to the signers with a more
explicit --signed-off-by option done in 6564828 (git-send-email:
Generalize auto-cc recipient mechanism) suffers from a double-negation
error.

A --signed-off-cc option, when false, should actively suppress CC: to be
generated out of S-o-b lines, and it should refrain from suppressing when
it is true.

It also fixes "(sob) Adding cc:" status output; earlier it included the
line terminator LF inside '%s', which was totally bogus.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-07 22:35:34 -08:00
Junio C Hamano
d33046c1ed Merge branch 'js/reflog-delete'
* js/reflog-delete:
  t3903-stash.sh: Add tests for new stash commands drop and pop
  git-reflog.txt: Document new commands --updateref and --rewrite
  t3903-stash.sh: Add missing '&&' to body of testcase
  git-stash: add new 'pop' subcommand
  git-stash: add new 'drop' subcommand
  git-reflog: add option --updateref to write the last reflog sha1 into the ref
  refs.c: make close_ref() and commit_ref() non-static
  git-reflog: add option --rewrite to update reflog entries while expiring
  reflog-delete: parse standard reflog options
  builtin-reflog.c: fix typo that accesses an unset variable
  Teach "git reflog" a subcommand to delete single entries
2008-03-07 22:34:26 -08:00
Junio C Hamano
5628a7a309 Merge branch 'dc/format-pretty'
* dc/format-pretty:
  log/show/whatchanged: introduce format.pretty configuration
  specify explicit "--pretty=medium" with `git log/show/whatchanged`
  whatchanged documentation: share description of --pretty with others
2008-03-07 22:33:26 -08:00
Junio C Hamano
003b93cfb3 Merge branch 'cb/mergetool'
* cb/mergetool:
  Add a very basic test script for git mergetool
  Teach git mergetool to use custom commands defined at config time
  Changed an internal variable of mergetool to support custom commands
  Tidy up git mergetool's backup file behaviour
2008-03-07 22:30:07 -08:00
Pierre Habouzit
c8744d6a8b unquote_c_style: fix off-by-one.
The optional endp parameter to unquote_c_style() was supposed to point at
a location past the closing double quote, but it was going one beyond it.

git-fast-import used this function heavily and the bug caused it to
misparse the input stream, especially when parsing a rename command:

	R "filename that needs quoting" rename-target-name

Because the function erroneously ate the whitespace after the closing dq,
this triggered "Missing space after source" error when it shouldn't.

Thanks to Adeodato Simò for having caught this.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-07 13:31:30 -08:00
Junio C Hamano
c2116a1783 test-lib: fix TERM to dumb for test repeatability
Dscho noticed that Term::ReadLine (used by send-email) colorized its
output for his TERM settings, inside t9001 tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-07 13:29:07 -08:00
Uwe Kleine-König
79f43f3de8 config.txt: refer to --upload-pack and --receive-pack instead of --exec
The options --upload-pack (of git-fetch-pack) and --receive-pack (of
git-push) do the same as --exec (for both commands).  But the former options
have the more descriptive name.

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-07 13:29:07 -08:00
Junio C Hamano
e3172d80d5 Merge branch 'ar/sgid-bsd'
* ar/sgid-bsd:
  Do not use GUID on dir in git init --shared=all on FreeBSD
2008-03-07 10:53:14 -08:00
Junio C Hamano
792f0e7d1a Merge branch 'cc/run-command'
* cc/run-command:
  run-command: Redirect stderr to a pipe before redirecting stdout to stderr
2008-03-07 10:53:10 -08:00
Junio C Hamano
891e85a0c0 Merge branch 'maint' of git://repo.or.cz/git-gui into maint
* 'maint' of git://repo.or.cz/git-gui:
  git-gui: Gracefully fall back to po2msg.sh if msgfmt --tcl fails
2008-03-06 00:18:23 -08:00
Andy Whitcroft
c1ce83a5b6 shortlog: take the first populated line of the description
Way back the perl version of shortlog would take the first populated line
of the commit body.  The builtin version mearly takes the first line.
This leads to empty shortlog entries when there is some viable text in
the commit.

Reinstate this behaviour igoring all lines with nothing but whitespace.
This is often useful when dealing with commits imported from foreign SCMs
that do not tidy up the log message of useless blank lines at the beginning.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 13:28:39 -08:00
Alex Riesen
81a24b52c1 Do not use GUID on dir in git init --shared=all on FreeBSD
It does not allow changing the bit to a non-root user.
This fixes t1301-shared-repo.sh on the platform.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 12:22:26 -08:00
Christian Couder
ce2cf27adc run-command: Redirect stderr to a pipe before redirecting stdout to stderr
With this patch, in the 'start_command' function after forking
we now take care of stderr in the child process before stdout.

This way if 'start_command' is called with a 'child_process'
argument like this:

	.err = -1;
	.stdout_to_stderr = 1;

then stderr will be redirected to a pipe before stdout is
redirected to stderr. So we can now get the process' stdout
from the pipe (as well as its stderr).

Earlier such a call would have redirected stdout to stderr
before stderr was itself redirected, and therefore stdout
would not have followed stderr, which would not have been
very useful anyway.

Update documentation in 'api-run-command.txt' accordingly.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 12:18:03 -08:00
SZEDER Gábor
b9217642ef bash: git-branch -d and -m lists only local branches
But still all branches are listed, if -r is present

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 12:10:29 -08:00
SZEDER Gábor
3b376b0cb8 bash: add git-branch options
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 12:10:29 -08:00
Charles Bailey
05e934bb9f Add a very basic test script for git mergetool
Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 12:07:04 -08:00
Charles Bailey
964473a042 Teach git mergetool to use custom commands defined at config time
Currently git mergetool is restricted to a set of commands defined
in the script. You can subvert the mergetool.<tool>.path to force
git mergetool to use a different command, but if you have a command
whose invocation syntax does not match one of the current tools then
you would have to write a wrapper script for it.

This patch adds two git config variable patterns which allow a more
flexible choice of merge tool.

If you run git mergetool with -t/--tool or the merge.tool config
variable set to an unrecognized tool then git mergetool will query the
mergetool.<tool>.cmd config variable. If this variable exists, then git
mergetool will treat the specified tool as a custom command and will use
a shell eval to run the command with the documented shell variables set.

mergetool.<tool>.trustExitCode can be used to indicate that the exit
code of the custom command can be used to determine the success of the
merge.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 12:07:04 -08:00
Charles Bailey
b3ea27e4de Changed an internal variable of mergetool to support custom commands
The variable $path changes to $MERGED so that it is more consistent
with $BASE, $LOCAL and $REMOTE for future custom command lines.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 12:07:03 -08:00
Charles Bailey
44c36d1ccc Tidy up git mergetool's backup file behaviour
Currently a backup pre-merge file with conflict markers is sometimes
kept with a .orig extenstion and sometimes removed depending on the
particular merge tool used.

This patch makes the handling consistent across all merge tools and
configurable via a new mergetool.keepBackup config variable

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 12:07:03 -08:00
Denis Cheng
94c22a5e7b log/show/whatchanged: introduce format.pretty configuration
When running log/show/whatchanged from the command line, the user may
want to use a preferred format without having to pass --pretty=<fmt>
option every time from the command line.  This teaches these three
commands to honor a new configuration variable, format.pretty.

The --pretty option given from the command line will override the
configured format.

The earlier patch fixed the in-tree callers that run these commands
for purposes other than showing the output directly to the end user
(the only other in-tree caller is "git bisect visualize", whose output
directly goes to the end user and should be affected by this patch).

Similar fixes will be needed for end-user scripts that parse the
output from these commands and expect them to be in the default pretty
format.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 12:06:09 -08:00
Denis Cheng
9225d7be0a specify explicit "--pretty=medium" with git log/show/whatchanged
The following patch will introduce a new configuration variable,
"format.pretty", from then on the pretty format without specifying
"--pretty" might not be the default "--pretty=medium", it depends on
the user's config. So all kinds of Shell/Perl/Emacs scripts that needs
the default medium pretty format must specify it explicitly.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 12:06:09 -08:00
Denis Cheng
5348337a34 whatchanged documentation: share description of --pretty with others
The documentation had its own description for --pretty and did not
include pretty-options/formats as documentation for other commands in
the "log" family did.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 12:06:09 -08:00
Junio C Hamano
79b1138e78 fsck.c: fix bogus "empty tree" check
ba002f3 (builtin-fsck: move common object checking code to fsck.c) did
more than what it claimed to.  Most notably, it wrongly made an empty tree
object an error by pretending to only move code from fsck_tree() in
builtin-fsck.c to fsck_tree() in fsck.c, but in fact adding a bogus check
to barf on an empty tree.

An empty tree object is _unusual_.  Recent porcelains try reasonably hard
not to let the user create a commit that contains such a tree.  Perhaps
warning about them in git-fsck may have some merit.

HOWEVER.

Being unusual and being errorneous are two quite different things.  This
is especially true now we seem to use the same fsck_$object() code in
places other than git-fsck itself.  For example, receive-pack should not
reject unusual objects, even if it would be a good idea to tighten it to
reject incorrect ones.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 10:32:01 -08:00
Shawn O. Pearce
21623062ab git-gui: Gracefully fall back to po2msg.sh if msgfmt --tcl fails
Mac OS X Tiger may have a msgfmt available but it doesn't understand
how to implement --tcl.  Falling back to po2msg.sh on such systems
is a reasonable behavior.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-05 02:13:16 -05:00
Junio C Hamano
c95b3ad9ea Revert "unpack-objects: prevent writing of inconsistent objects"
This reverts commit d5ef408b9afb5b4417f4e7e1593a96302d666650.
2008-03-04 03:11:30 -08:00
Junio C Hamano
9eb7a50b6d Revert "receive-pack: use strict mode for unpacking objects"
This reverts commit 28f72a0f232dfc71b3be726e7e71d0a6d5f9ebba.
2008-03-04 03:11:06 -08:00
Junio C Hamano
27b4070e40 Merge branch 'maint'
* maint:
  Fix 'git remote show' regression on empty repository in 1.5.4
  Fix incorrect wording in git-merge.txt.
  git-merge.sh: better handling of combined --squash,--no-ff,--no-commit options
  Fix random crashes in http_cleanup()
2008-03-04 00:34:39 -08:00
Shawn O. Pearce
52dce39762 Fix 'git remote show' regression on empty repository in 1.5.4
Back in 18f7c51c we switched git-ls-remote/git-peek-remote to
use the transport backend, rather than do everything itself.

As part of that switch we started to produce a non-zero exit
status if no refs were received from the remote peer, which
happens when the remote peer has no commits pushed to it yet.
(E.g. "git --git-dir=foo.git init; git ls-remote foo.git")

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 22:47:14 -08:00
Mike Hommey
4947cf9cc3 t3407-rebase-abort.sh: Enhance existing tests, and add test for rebase --merge
Removing .dotest should actually not be needed, so just test the directory
don't exist after --abort, but exists after starting the rebase.

Also, execute the same tests with rebase --merge, which uses a different code
path.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 22:13:57 -08:00
Simon Hausmann
30b5940bcd git-p4: Fix import of changesets with file deletions
Commit 3a70cdfa42199e16d2d047c286431c4274d65b1a made readP4Files abort quickly
when the changeset only contains files that are marked for deletion with an empty return
value, which caused the commit to not do anything.

This commit changes readP4Files to distinguish between files that need to be passed to p4
print and files that have no content ("deleted") and merge them in the returned
list.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 21:53:51 -08:00
Alex Riesen
a798b2c0f6 Fix test for cleanup failure in t7300 on Windows
Keep the file open to: the OS does not allow removal of open files.
The saner systems just have a saner permission model and chmod 0
is enough for the test.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 21:52:04 -08:00
Junio C Hamano
4d4c3e1c12 t6120 (describe): check --long properly
Existing test checked --long only for exactly tagged commit.  We should
make sure it works sensibly for commits that are not tagged.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 18:29:51 -08:00
Shawn O. Pearce
3291fe4072 Add git-describe test for "verify annotated tag names on output"
Back in 212945d4 ("Teach git-describe to verify annotated tag names
before output") I taught git-describe to output the name shown in the
"tag" header of an annotated tag, rather than the name it is actually
stored under in this repository's ref namespace.

This test case verifies this is working correctly by renaming the ref
for an annotated tag to a different name that what is recorded in the
tag body, and verifying that tag is returned.  We also verify there is
a message shown on stderr to inform the user that the tag is possibly
stored under the wrong name locally.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 18:26:40 -08:00
Shawn O. Pearce
d1b28f512c Test for packed tags in git-describe output
In c374b91c ("git-describe: use tags found in packed-refs correctly")
Junio fixed an issue where git-describe did not parse a tag object it
obtained from a packed-refs file, as the peel information was read in
from packed-refs and not the tag object itself.

This new test case verifies the fix listed above is functioning, and
does not have a regression in the future.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 18:26:29 -08:00
Shawn O. Pearce
be7bae0d48 Don't allow git-describe failures to go unnoticed in t6120
If git-describe fails we never execute the test_expect_success,
so we never actually test for failure.  This is horribly wrong.
We need to always run the test case, but the test case is only
supposed to succeed if the prior git-describe returned 0.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 18:26:23 -08:00
Junio C Hamano
3167d72565 describe: re-fix display_name()
It is implausible for lookup_tag() to return NULL in this particular
codepath but we should protect ourselves against a broken repository
better.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 15:54:23 -08:00
Matthieu Moy
81646ad247 Fix incorrect wording in git-merge.txt.
A merge is not necessarily with a remote branch, it can be with any
commit.

Thanks to Paolo Ciarrocchi for pointing out the problem, and to
Nicolas Pitre for pointing out the fact that a merge is not
necessarily with a branch head.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 13:40:15 -08:00
Gerrit Pape
e6d1f76ccf git-merge.sh: better handling of combined --squash,--no-ff,--no-commit options
git-merge used to use either the --squash,--no-squash, --no-ff,--ff,
--no-commit,--commit option, whichever came last in the command line.
This lead to some un-intuitive behavior, having

 git merge --no-commit --no-ff <branch>

actually commit the merge.  Now git-merge respects --no-commit together
with --no-ff, as well as other combinations of the options.  However,
this broke a selftest in t/t7600-merge.sh which expected to have --no-ff
completely override the --squash option, so that

 git merge --squash --no-ff <branch>

fast-forwards, and makes a merge commit; combining --squash with --no-ff
doesn't really make sense though, and is now refused by git-merge.  The
test is adapted to test --no-ff without the preceding --squash, and
another test is added to make sure the --squash --no-ff combination is
refused.

The unexpected behavior was reported by John Goerzen through
 http://bing.sdebian.org/468568

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 13:38:30 -08:00
Mike Hommey
f23d1f7627 Fix random crashes in http_cleanup()
For some reason, http_cleanup was running all active slots, which could
lead in situations where a freed slot would be accessed in
fill_active_slots. OTOH, we are cleaning up, which means the caller
doesn't care about pending requests. Just forget about them instead
or running them.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 13:36:44 -08:00
Junio C Hamano
870cf7d698 describe: fix --long output
An error while hand-merging broke the new "--long" option.

This should fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 13:09:20 -08:00
Junio C Hamano
c374b91cf2 git-describe: use tags found in packed-refs correctly
When your refs are packed, "git-describe" can find the tag that is the
best match without ever parsing the tag itself.  But lookup_tag() in
display_name() says "I've never seen it", creates an empty shell, and
returns it.  We need to make sure that we actually have parsed the tag
data into it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 09:24:17 -08:00
Brandon Casey
b683c08082 t3903-stash.sh: Add tests for new stash commands drop and pop
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 01:20:59 -08:00
Brandon Casey
cf2756ae19 git-reflog.txt: Document new commands --updateref and --rewrite
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 01:20:59 -08:00
Brandon Casey
059f13045a t3903-stash.sh: Add missing '&&' to body of testcase
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 01:20:59 -08:00
Junio C Hamano
f830d45b9f Merge commit '74359821' into js/reflog-delete
* commit '74359821': (128 commits)
  tests: introduce test_must_fail
  Fix builtin checkout crashing when given an invalid path
  templates/Makefile: don't depend on local umask setting
  Correct name of diff_flush() in API documentation
  Start preparing for 1.5.4.4
  format-patch: remove a leftover debugging message
  completion: support format-patch's --cover-letter option
  Eliminate confusing "won't bisect on seeked tree" failure
  builtin-reflog.c: don't install new reflog on write failure
  send-email: fix In-Reply-To regression
  git-svn: Don't prompt for client cert password everytime.
  git.el: Do not display empty directories.
  Fix 'git cvsexportcommit -w $cvsdir ...' when used with relative $GIT_DIR
  Add testcase for 'git cvsexportcommit -w $cvsdir ...' with relative $GIT_DIR
  Prompt to continue when editing during rebase --interactive
  Documentation/git svn log: add a note about timezones.
  git-p4: Support usage of perforce client spec
  git-p4: git-p4 submit cleanups.
  git-p4: Removed git-p4 submit --direct.
  git-p4: Clean up git-p4 submit's log message handling.
  ...
2008-03-03 01:20:19 -08:00
Martin Koegler
f3ec549481 fetch-pack: check parse_commit/object results
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 01:13:05 -08:00
Junio C Hamano
2d3539e87a Update draft release notes for 1.5.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 00:05:38 -08:00