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

14169 Commits

Author SHA1 Message Date
Andy Parkins
71bd81ade2 post-receive-email: fix accidental removal of a trailing space in signature line
post-receive-email adds a signature to the end of emails in
generate_email_footer().  The signature was separated from the main email
body using the standard string "-- ". (see RFC 3676)

a6080a0 (War on whitespace, 2007-06-07) removed the trailing whitespace
from "-- ", leaving it as "--", which is not a correct signature
separator.

This patch restores the missing space, but does it in a way that will
not set off the trailing whitespace alarms.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-21 23:36:56 -07:00
martin f. krafft
85d17a123b Escape project names before creating pathinfo URLs
If a project name contains special URL characters like +, gitweb's links
break in subtle ways. The solution is to pass the project name through
esc_url() and using the return value.

Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-21 23:30:55 -07:00
martin f. krafft
bbd4c307fc Escape project name in regexp
The project name, when used in a regular expression, needs to be quoted
properly, so that stuff like '++' in the project name does not cause
Perl to barf.

Related info: http://bugs.debian.org/476076
This is a bug in Perl's CGI.pm, but fixing that exposed a similar bug in
gitweb.perl

Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-21 23:30:11 -07:00
Teemu Likonen
f457413908 bash: Add completion for git diff --base --ours --theirs
Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-21 22:52:15 -07:00
Gerrit Pape
37152d8310 diff-options.txt: document the new "--dirstat" option
This commit adds the documentation for the new option added by 7df7c01
(Add "--dirstat" for some directory statistics, 2008-02-12).

Noticed by Clint Adams, reported through
 http://bugs.debian.org/476437

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-21 22:50:21 -07:00
Junio C Hamano
66aaa2fc22 GIT 1.5.5.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.5.5.1
2008-04-20 11:36:53 -07:00
Junio C Hamano
41a3e3aa9b Merge branch 'jc/maint-rebase-am' into maint
* jc/maint-rebase-am:
  rebase: do not munge commit log message

Conflicts:

	git-am.sh
2008-04-19 23:01:51 -07:00
Jakub Narebski
5634cf2476 gitweb: Fix 'history' view for deleted files with history
When asked for history of a file which is not present in given branch
("HEAD", i.e. current branch, or given by transient $hash_hase ('hb')
parameter), but is present deeper in the history (meaning that "git
rev-list --full-history $hash_base -- $file_name" is not empty), and
there is no $hash ('h') parameter set for a file, gitweb would spew
multiple of "Use of uninitialized value" warnings, and some links
would be missing.  This commit fixes this bug.

This bug occurs in the rare cases when "git log -- <path>" is empty
and "git log --full-history -- <path>" is not, or to be more exact in
the cases when full-history starts later than given branch.  It can
happen if you are using handcrafted gitwb URL, or if you follow
generic 'history' link or bookmark for a file which got deleted.

Gitweb tried to get file type ('tree', or 'blob', or even 'commit')
from the commit we start searching from (where the file was not
present), and not among found commits.  This was the cause of "Use of
uninitialized value" warnings.

This commit also add tests for such situation to t9500 test.

While we are it, return HTTP error if there is _no_ history; it means
that file or directory was not found (for given branch).  Also error
out if type of item could not be found: it should not happen now, but
better be sure.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-18 22:10:38 -07:00
Matthieu Moy
f01f81505a Document that WebDAV doesn't need git on the server, and works over SSL
I managed to set up a Git repository on a preconfigured WebDAV server,
and using HTTPS, without installing Git on it or changing the server
configuration. This works through a proxy too. This patch reflects
this (it previously stated that Git was _necessary_ on the server,
which isn't true). Also give a few hints to troubleshoting.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-18 22:09:24 -07:00
Junio C Hamano
4c414e2e09 Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  am: POSIX portability fix
2008-04-18 22:07:00 -07:00
Jonas Fonseca
24b6177e02 git-remote: reject adding remotes with invalid names
This can happen if the arguments to git-remote add is switched by the
user, and git would only show an error if fetching was also requested.
Fix it by using the refspec parsing engine to check if the requested
name can be parsed as a remote before add it.

Also cleanup so that the "remote.<name>.url" config name buffer is only
initialized once.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-18 16:31:27 -07:00
Junio C Hamano
29df2385d0 am: POSIX portability fix
POSIX allows echo without flag to interpret specials such as \n, and we
tried to make things portable by using printf instead where it matters.
Recently added code to "git am" had unprotected "echo", which was caught
by t4014 and Rémi Vanicat.

This should fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-18 16:11:40 -07:00
Junio C Hamano
d0ab520a25 Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  git-am: minor cleanup
  Clarify and fix English in "git-rm" documentation
2008-04-16 17:04:05 -07:00
Junio C Hamano
11dc4e70c3 git-am: minor cleanup
This moves the assignment to FIRSTLINE down so that we do not have
to have multiple copies.

Suggested by Linus.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-16 16:46:26 -07:00
Jon Loeliger
25dc720077 Clarify and fix English in "git-rm" documentation
Do some verb-noun agreement changes.
Clarify some file globbing cases.
Fixed a wrong statement in an example.

Signed-off-by: Jon Loeliger <jdl@jdl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-16 16:45:23 -07:00
Junio C Hamano
5e835cac86 rebase: do not munge commit log message
Traditionally git-rebase was implemented in terms of "format-patch" piped
to "am -3", to strike balance between speed (because it avoids a rather
expensive read-tree/merge-recursive machinery most of the time) and
flexibility (the magic "-3" allows it to fall back to 3-way merge as
necessary).  However, this combination has one flaw when dealing with a
nonstandard commit log message format that has more than one lines in the
first paragraph.

This teaches "git am --rebasing" to take advantage of the fact that the
mbox message "git rebase" prepares for it records the original commit
object name, to get the log message from the original commit object
instead.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-16 12:50:48 -07:00
Junio C Hamano
464509f790 Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  git-bisect: make "start", "good" and "skip" succeed or fail atomically
  git-am: cope better with an empty Subject: line
  Ignore leading empty lines while summarizing merges
  bisect: squelch "fatal: ref HEAD not a symref" misleading message
  builtin-apply: Show a more descriptive error on failure when opening a patch
  Clarify documentation of git-cvsserver, particularly in relation to git-shell
2008-04-16 00:37:33 -07:00
Christian Couder
d3e54c8829 git-bisect: make "start", "good" and "skip" succeed or fail atomically
Before this patch, when "git bisect start", "git bisect good" or
"git bisect skip" were called with many revisions, they could fail
after having already marked some revisions as "good", "bad" or
"skip".

This could be especilally bad for "git bisect start" because as
the file ".git/BISECT_NAMES" would not have been written, there
would have been no attempt to clear the marked revisions on a
"git bisect reset". That's because if there is no
".git/BISECT_NAMES" file, nothing is done to clean things up, as
the bisect session is not supposed to have started.

While at it, let's also create the ".git/BISECT_START" file, only
after ".git/BISECT_NAMES" as been created.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-16 00:11:37 -07:00
Linus Torvalds
2e6e3e829f git-am: cope better with an empty Subject: line
When the Subject: line is empty for whatever reason, git-am was fooled by
it and left an empty line at the beginning of the resulting commit log
message.

This moves the logic around so that we do not keep $SUBJECT in a separate
variable.  Instead, $dotest/msg-clean, which used to be the log message
body extracted from the message and then trailing whitespaces cleansed
out, now contains the subject line followed by a blank line at the
beginning for normal messages, and we use the first line from the file as
the summary line throughout the program.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-16 00:11:04 -07:00
Linus Torvalds
6a28518ae0 Ignore leading empty lines while summarizing merges
"git log" and friends normally skip the initial empty lines when showing
one-line summary of a commit, but merge summary didn't.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
----
 builtin-fmt-merge-msg.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-15 23:53:26 -07:00
Christian Couder
48949a18c8 bisect: squelch "fatal: ref HEAD not a symref" misleading message
To get the current HEAD when we start bisecting using for example
"git bisect start", we first try "git symbolic-ref HEAD" to get a
nice name, and if it fails, we fall back to "git rev-parse
--verify HEAD".

The problem is that when "git symbolic-ref HEAD" fails, it
displays "fatal: ref HEAD not a symref", so it looks like "git
bisect start" failed and does not accept detached HEAD, even if
in fact it worked fine.

This patch adds "-q" option to the "git symbolic-ref" call to
get rid of the misleading error message.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-15 22:42:19 -07:00
Alberto Bertogli
1da16439be builtin-apply: Show a more descriptive error on failure when opening a patch
When a patch can't be opened (it doesn't exist, there are permission
problems, etc.) we get the usage text, which is not a proper indication of
failure.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-15 22:42:08 -07:00
Scott Collins
2c2d02a6a7 Clarify documentation of git-cvsserver, particularly in relation to git-shell
For SSH clients restricted to git-shell, CVS_SERVER does not have to be
specified, because git-shell understands the default value of 'cvs' to
mean git-cvsserver'. This makes it totally transparent to CVS users, but
the instruction to set up CVS access for people with real shell access
does not apply.

Previous wording mentioning GIT_AUTHOR, GIT_COMMITTER variables was
unclear that we really meant GIT_AUTHOR_(NAME|EMAIL), etc.

Note that the .ssh/environment file is a good place to set these, and that
the .bashrc is shell-specific. Add a bit of text to differentiate cvs -d
(setting CVSROOT) from cvs co -d (setting the name of the newly checked
out directory).  Removed an extra 'Example:' string.

Signed-off-by: Scott Collins <scc@ScottCollins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-15 22:41:54 -07:00
Shawn Bohrer
2b6f0b0a78 git clean: Add test to verify directories aren't removed with a prefix
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-14 23:14:58 -07:00
Shawn Bohrer
f2d0df7148 git clean: Don't automatically remove directories when run within subdirectory
When git clean is run from a subdirectory it should follow the normal
policy and only remove directories if they are passed in as a pathspec,
or -d is specified.

The fix is to send len which could be shorter than ent->len because we
have stripped the trailing '/' that read_directory adds. Additionaly
match_one() was modified to allow a name[] that is not NUL terminated.
This allows us to check if the name matched the pathspec exactly
instead of recursively.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-14 23:14:58 -07:00
Mark Levedahl
f669ac0be9 git-submodule - possibly use branch name to describe a module
This changes the search logic for describing a submodule from:
- annotated tag
- any tag
- tag on a subsequent commit
- commit id

to

- annotated tag
- any tag
- tag on a subsequent commit
- local or remote branch
- commit id

The change is describing with respect to a branch before falling
back to the commit id. By itself, git-submodule will maintain submodules
as headless checkouts without ever making a local branch. In
general, such heads can always be described relative to the remote branch
regardless of existence of tags, and so provides a better fallback
summary than just the commit id.

This requires inserting an extra describe step as --contains is
incompatible with --all, but the latter can be used with --always
to fall back to a commit ID. Also, --contains implies --tags, so the
latter is not needed.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-14 23:14:08 -07:00
Junio C Hamano
02604e293a t7401: squelch garbage output
The script had an unconditional output done outside of test_expect_*
construct, which leaked out and contaminated the output without -v.
Squelch it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 18:57:08 -07:00
Junio C Hamano
51836e9e12 Documentation/git-submodule: typofix
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 18:34:39 -07:00
Daniel Barkalow
60e3aba9c3 Fix config key miscount in url.*.insteadOf
Also tighten test to require it to be correct.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 15:41:24 -07:00
Junio C Hamano
d6d96f835c Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  Docs gitk: Explicitly mention the files that gitk uses (~/.gitk)
  Document -w option to shortlog
  bisect: report bad rev better
2008-04-12 15:41:19 -07:00
Clifford Caoile
e80950786c Docs gitk: Explicitly mention the files that gitk uses (~/.gitk)
gitk creates and uses ~/.gitk

Signed-off-by: Clifford Caoile <piyo@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 15:39:07 -07:00
Junio C Hamano
55ef8a4610 Document -w option to shortlog
Noticed by Fredrik Noring.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 15:38:20 -07:00
Christian Couder
a179a30352 bisect: report bad rev better
The previous one overwrote the variable used to report the bad input
when the input is actually bad, and we did not give a useful enough
information.  This corrects it.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 15:16:13 -07:00
Junio C Hamano
eed81838f0 Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  bisect: fix bad rev checking in "git bisect good"
  revision.c: make --date-order overriddable
  Fix section about backdating tags in the git-tag docs
  Document option --only of git commit
  Documentation/git-request-pull: Fixed a typo ("send" -> "end")
2008-04-11 23:55:55 -07:00
Christian Couder
e3389075c6 bisect: fix bad rev checking in "git bisect good"
It seems that "git bisect good" and "git bisect skip" have never
properly checked arguments that have been passed to them. As soon
as one of them can be parsed as a SHA1, no error or warning would
be given.

This is because 'git rev-parse --revs-only --no-flags "$@"' always
"exit 0" and outputs all the SHA1 it can found from parsing "$@".

This patch fix this by using, for each "bisect good" argument, the
same logic as for the "bisect bad" argument.

While at it, this patch teaches "bisect bad" to give a meaningfull
error message when it is passed more than one argument.

Note that if "git bisect good" or "git bisect skip" is given some
proper revs and then something that is not a proper rev, then the
first proper revs will still have been marked as "good" or "skip".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-11 23:54:45 -07:00
Michele Ballabio
a710522bfc revision.c: make --date-order overriddable
Jan Engelhardt noticed that while --topo-order can be overridden by a
subsequent --date-order, the reverse was not possible. That's because
setup_revisions() failed to set revs->lifo properly.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-11 23:01:33 -07:00
Ping Yin
a68972c2ad git-submodule: Avoid 'fatal: cannot describe' message
When "git submodule status" command tries to show the name of the
submodule HEAD revision more descriptively, but the submodule
repository lacked a suitable tag to do so, it leaked "fatal: cannot
describe" message to the UI.  Squelch it by using '--always'.

Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-11 17:35:39 -07:00
Pedro Melo
b6309ac2b8 Force the medium pretty format on calls to git log
If a user has customized format.pretty in config, git-svn rebase fails with:

	Unable to determine upstream SVN information from working tree history

because the command expects to read the commit log in the default format.

This fixes the command to explicitly ask for the format it wants to read
from.

Signed-off-by: Pedro Melo <melo@simplicidade.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-11 17:35:35 -07:00
Björn Steinbrink
055b66158c Fix section about backdating tags in the git-tag docs
The tagger is equal to the committer, not the author, so
GIT_COMMITTER_DATE is the right environment variable to use, not
GIT_AUTHOR_DATE.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-11 17:34:05 -07:00
Johannes Sixt
d4ba07cac5 Document option --only of git commit
Its documentation was removed by 6c96753 (Documentation/git-commit: rewrite
to make it more end-user friendly, 2006-12-08), even though it is referenced
from a few places, including builtin-commit.c (as part of the commentary in
the commit message template).

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-11 12:54:15 -07:00
Dirk Suesserott
ca593f7959 Documentation/git-request-pull: Fixed a typo ("send" -> "end")
Signed-off-by: Dirk Suesserott <newsletter@dirk.my1.cc>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-11 12:25:30 -07:00
Jeff King
f59774add4 git-fetch: fix status output when not storing tracking ref
There was code in update_local_ref for handling this case,
but it never actually got called. It assumed that storing in
FETCH_HEAD meant a blank peer_ref name, but we actually have
a NULL peer_ref in this case, so we never even made it to
the update_local_ref function.

On top of that, the display formatting was different from
all of the other cases, probably owing to the fact that
nobody had ever actually seen the output.

This patch harmonizes the output with the other cases and
moves the detection of this case into store_updated_refs,
where we can actually trigger it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-10 00:30:44 -07:00
Junio C Hamano
179c94b24a Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  core-tutorial.txt: Fix showing the current behaviour.
  git-archive: ignore prefix when checking file attribute
  Fix documentation syntax of optional arguments in short options.
2008-04-10 00:29:33 -07:00
Carlos Rica
abea85d1e9 core-tutorial.txt: Fix showing the current behaviour.
The --root option from "git diff-tree" won't do nothing
when is given to commands like git-whatchanged or git-log,
because those always print the initial commit by default.

This fixes the tutorial explaining the function of the
log.showroot configuration variable.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-10 00:20:41 -07:00
René Scharfe
ac7fa2776c git-archive: ignore prefix when checking file attribute
Ulrik Sverdrup noticed that git-archive doesn't correctly apply the attribute
export-subst when the option --prefix is given, too.

When it checked if a file has the attribute turned on, git-archive would try
to look up the full path -- including the prefix -- in .gitattributes.  That's
wrong, as the prefix doesn't need to have any relation to any existing
directories, tracked or not.

This patch makes git-archive ignore the prefix when looking up if value of the
attribute export-subst for a file.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-10 00:20:38 -07:00
Carlos Rica
3f36cbbaaf Fix documentation syntax of optional arguments in short options.
When an argument for an option is optional, like in -n from git-tag,
puting a space between the option and the argument is interpreted
as a missing argument for the option plus an isolated argument.
Documentation now reflects the need to write the parameter following
the option -n, as in "git tag -nARG", for instance.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-10 00:20:31 -07:00
Junio C Hamano
1d2375ddfe GIT 1.5.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.5.5
2008-04-07 21:57:43 -07:00
Junio C Hamano
fae09a8084 Merge git://git.kernel.org/pub/scm/gitk/gitk
* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Fix changing colors through Edit->Preferences
2008-04-07 21:52:23 -07:00
Eric Wong
f61cc48d28 git-svn: fix following renamed paths when tracking a single path
When using git-svn to follow only a single (empty) path per
svn-remote (i.e. not using --stdlayout), following the history
of a renamed path was broken in
c586879cdfa4f8181a14e953a9152a4639eef333.

This reverts the regression for the single (emtpy) path per
svn-remote case.

To avoid breaking the tests in a committed revision, this is an
addendum to a patch originally submitted by

  Santhosh Kumar Mani <santhoshmani@gmail.com>:
  > git-svn: add test for renamed directory fetch
  >
  > This test tries to fetch a directory which had renames in the
  > history from a SVN repository.

  [ew: unneccesary dependency on the starting an HTTP server
   removed from Santhosh's original test.]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-07 00:16:08 -07:00
Junio C Hamano
a1c0dca43a Merge branch 'jc/maint-apply-match-beginning'
* jc/maint-apply-match-beginning:
  Fix "git apply" to correctly enforce "match at the beginning"
2008-04-06 20:04:29 -07:00