Lars Hjemli [Thu, 17 Apr 2008 20:24:50 +0000 (22:24 +0200)]
git-branch: add support for --merged and --no-merged
These options filter the output from git branch to only include branches
whose tip is either merged or not merged into HEAD.
The use-case for these options is when working with integration of branches
from many remotes: `git branch --no-merged -a` will show a nice list of merge
candidates while `git branch --merged -a` will show the progress of your
integration work.
Also, a plain `git branch --merged` is a quick way to find local branches
which you might want to delete.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 20 Apr 2008 23:03:40 +0000 (16:03 -0700)]
First batch of post 1.5.5 updates
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 20 Apr 2008 22:51:57 +0000 (15:51 -0700)]
Merge branch 'maint'
* maint:
GIT 1.5.5.1
Junio C Hamano [Sun, 20 Apr 2008 18:36:53 +0000 (11:36 -0700)]
GIT 1.5.5.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 20 Apr 2008 06:01:51 +0000 (23:01 -0700)]
Merge branch 'jc/maint-rebase-am' into maint
* jc/maint-rebase-am:
rebase: do not munge commit log message
Conflicts:
git-am.sh
Junio C Hamano [Sun, 20 Apr 2008 04:12:52 +0000 (21:12 -0700)]
Merge branch 'jc/sha1-lookup'
* jc/sha1-lookup:
sha1-lookup: make selection of 'middle' less aggressive
sha1-lookup: more memory efficient search in sorted list of SHA-1
Junio C Hamano [Sun, 20 Apr 2008 04:12:34 +0000 (21:12 -0700)]
Merge branch 'jc/dirstat'
* jc/dirstat:
diff: make --dirstat binary-file safe
Junio C Hamano [Sun, 20 Apr 2008 04:12:24 +0000 (21:12 -0700)]
Merge branch 'mv/defer-gc'
* mv/defer-gc:
contrib/hooks: add an example pre-auto-gc hook
Documentation/hooks: add pre-auto-gc hook
git-gc --auto: add pre-auto-gc hook
Junio C Hamano [Sun, 20 Apr 2008 04:11:29 +0000 (21:11 -0700)]
Merge branch 'py/submodule'
* py/submodule:
builtin-status: Add tests for submodule summary
builtin-status: submodule summary support
git-submodule summary: --for-status option
Junio C Hamano [Sun, 20 Apr 2008 04:10:54 +0000 (21:10 -0700)]
Merge branch 'jc/terminator-separator'
* jc/terminator-separator:
log: teach "terminator" vs "separator" mode to "--pretty=format"
Junio C Hamano [Sun, 20 Apr 2008 04:10:24 +0000 (21:10 -0700)]
Merge branch 'jk/remote-default-show'
* jk/remote-default-show:
git-remote: show all remotes with "git remote show"
Junio C Hamano [Sun, 20 Apr 2008 04:09:54 +0000 (21:09 -0700)]
Merge branch 'mk/color'
* mk/color:
Use color.ui variable in scripts too
Junio C Hamano [Sat, 19 Apr 2008 07:25:15 +0000 (00:25 -0700)]
Merge branch 'jc/maint-rebase-am'
* jc/maint-rebase-am:
rebase: do not munge commit log message
Conflicts:
git-am.sh
Junio C Hamano [Sat, 19 Apr 2008 05:58:32 +0000 (22:58 -0700)]
Merge branch 'maint'
* maint:
gitweb: Fix 'history' view for deleted files with history
Document that WebDAV doesn't need git on the server, and works over SSL
git-remote: reject adding remotes with invalid names
am: POSIX portability fix
Jakub Narebski [Sun, 13 Apr 2008 12:12:15 +0000 (14:12 +0200)]
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>
Matthieu Moy [Sun, 13 Apr 2008 13:38:21 +0000 (15:38 +0200)]
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>
Junio C Hamano [Sat, 19 Apr 2008 05:07:00 +0000 (22:07 -0700)]
Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
am: POSIX portability fix
Jonas Fonseca [Sun, 13 Apr 2008 09:56:54 +0000 (11:56 +0200)]
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>
Junio C Hamano [Fri, 18 Apr 2008 23:11:40 +0000 (16:11 -0700)]
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>
Junio C Hamano [Thu, 17 Apr 2008 00:49:52 +0000 (17:49 -0700)]
Merge branch 'maint'
* maint:
git-am: minor cleanup
Clarify and fix English in "git-rm" documentation
Junio C Hamano [Thu, 17 Apr 2008 00:04:05 +0000 (17:04 -0700)]
Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
git-am: minor cleanup
Clarify and fix English in "git-rm" documentation
Junio C Hamano [Wed, 16 Apr 2008 23:46:26 +0000 (16:46 -0700)]
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>
Jon Loeliger [Wed, 16 Apr 2008 23:41:27 +0000 (18:41 -0500)]
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>
Junio C Hamano [Wed, 16 Apr 2008 19:50:48 +0000 (12:50 -0700)]
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>
Junio C Hamano [Wed, 16 Apr 2008 07:45:52 +0000 (00:45 -0700)]
Merge branch 'maint'
* maint:
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
Junio C Hamano [Wed, 16 Apr 2008 07:37:33 +0000 (00:37 -0700)]
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
Christian Couder [Mon, 14 Apr 2008 03:41:45 +0000 (05:41 +0200)]
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>
Linus Torvalds [Tue, 15 Apr 2008 19:56:50 +0000 (12:56 -0700)]
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>
Linus Torvalds [Tue, 15 Apr 2008 18:01:36 +0000 (11:01 -0700)]
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>
Christian Couder [Wed, 16 Apr 2008 02:09:49 +0000 (04:09 +0200)]
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>
Alberto Bertogli [Mon, 14 Apr 2008 15:30:27 +0000 (12:30 -0300)]
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>
Scott Collins [Tue, 15 Apr 2008 21:44:43 +0000 (17:44 -0400)]
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>
Junio C Hamano [Tue, 15 Apr 2008 06:15:09 +0000 (23:15 -0700)]
Merge branch 'maint'
* maint:
git clean: Add test to verify directories aren't removed with a prefix
git clean: Don't automatically remove directories when run within subdirectory
git-submodule - possibly use branch name to describe a module
Shawn Bohrer [Sun, 13 Apr 2008 23:49:38 +0000 (18:49 -0500)]
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>
Shawn Bohrer [Tue, 15 Apr 2008 03:14:09 +0000 (22:14 -0500)]
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>
Mark Levedahl [Tue, 15 Apr 2008 02:48:06 +0000 (22:48 -0400)]
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>
Stephan Beyer [Tue, 8 Apr 2008 08:42:33 +0000 (10:42 +0200)]
builtin-apply.c: use git_config_string() to get apply_default_whitespace
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 13 Apr 2008 19:11:11 +0000 (12:11 -0700)]
Fix git_config_bool_or_int
The earlier one botched the return value logic between config_bool and
config_bool_and_int. The former should normalize between 0 and 1 while
the latter should give back full range of integer values.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ping Yin [Sat, 12 Apr 2008 15:05:33 +0000 (23:05 +0800)]
builtin-status: Add tests for submodule summary
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ping Yin [Sat, 12 Apr 2008 15:05:32 +0000 (23:05 +0800)]
builtin-status: submodule summary support
This commit teaches 'git commit/status' show a new 'Modified submodules'
section, which is an output from:
git submodule summary --cached --for-status --summary-limit <limit>
just before the 'Untracked files' section.
The <limit> is given by the config variable status.submodulesummary
to limit the submodule summary size. status.submodulesummary is a
bool/int variable with value:
- false or 0 by default to disable the summary, or
- positive number to limit the summary size, or
- true or negative number to unlimit the summary size.
Also mention status.submodulesummary in the documentation.
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ping Yin [Sat, 12 Apr 2008 15:05:31 +0000 (23:05 +0800)]
git-submodule summary: --for-status option
The --for-status option is mainly used by builtin-status/commit.
It adds 'Modified submodules:' line at top and '# ' prefix to all
following lines.
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 13 Apr 2008 02:17:51 +0000 (19:17 -0700)]
Merge branch 'maint'
* maint:
t7401: squelch garbage output
Documentation/git-submodule: typofix
Fix config key miscount in url.*.insteadOf
Docs gitk: Explicitly mention the files that gitk uses (~/.gitk)
Document -w option to shortlog
bisect: report bad rev better
Junio C Hamano [Sun, 13 Apr 2008 01:57:08 +0000 (18:57 -0700)]
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>
Junio C Hamano [Sun, 13 Apr 2008 01:33:31 +0000 (18:33 -0700)]
git_config_bool_or_int()
This new function can be used by config parsers to tell if a variable
is simply set, set to 1, or set to "true".
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 13 Apr 2008 01:34:39 +0000 (18:34 -0700)]
Documentation/git-submodule: typofix
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Daniel Barkalow [Sat, 12 Apr 2008 19:32:00 +0000 (15:32 -0400)]
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>
Junio C Hamano [Sat, 12 Apr 2008 22:41:19 +0000 (15:41 -0700)]
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
Clifford Caoile [Sat, 12 Apr 2008 09:50:20 +0000 (18:50 +0900)]
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>
Junio C Hamano [Sat, 12 Apr 2008 22:38:20 +0000 (15:38 -0700)]
Document -w option to shortlog
Noticed by Fredrik Noring.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder [Sat, 12 Apr 2008 09:17:36 +0000 (02:17 -0700)]
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>
Junio C Hamano [Sat, 12 Apr 2008 06:56:09 +0000 (23:56 -0700)]
Merge branch 'maint'
* maint:
bisect: fix bad rev checking in "git bisect good"
revision.c: make --date-order overriddable
git-submodule: Avoid 'fatal: cannot describe' message
Force the medium pretty format on calls to git log
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")
Junio C Hamano [Sat, 12 Apr 2008 06:55:55 +0000 (23:55 -0700)]
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")
Christian Couder [Sat, 12 Apr 2008 05:53:59 +0000 (07:53 +0200)]
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>
Christian Couder [Fri, 11 Apr 2008 03:55:21 +0000 (05:55 +0200)]
bisect: add "git bisect help" subcommand to get a long usage string
Users are not often aware of the fact that "git bisect -h" can give
them a long usage description, as "git bisect" seems to accept only
dashless subcommands like "start", "good", ...
That's why this patch adds a "git bisect help" subcommand that just
calls "git bisect -h". This new subcommand is also fully documented
in the short usage string (that "git bisect" gives), in the long
usage string and in the man page (that "git help bisect" gives).
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt [Thu, 10 Apr 2008 11:33:08 +0000 (13:33 +0200)]
builtin-commit.c: Remove a redundant assignment.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michele Ballabio [Thu, 10 Apr 2008 20:06:52 +0000 (22:06 +0200)]
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>
Ping Yin [Thu, 10 Apr 2008 14:45:29 +0000 (22:45 +0800)]
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>
Pedro Melo [Thu, 10 Apr 2008 16:05:21 +0000 (17:05 +0100)]
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>
Björn Steinbrink [Fri, 11 Apr 2008 20:52:07 +0000 (22:52 +0200)]
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>
Johannes Sixt [Thu, 10 Apr 2008 11:33:09 +0000 (13:33 +0200)]
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>
Dirk Suesserott [Wed, 9 Apr 2008 20:20:10 +0000 (22:20 +0200)]
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>
Matthias Kestenholz [Wed, 9 Apr 2008 19:32:06 +0000 (21:32 +0200)]
Use color.ui variable in scripts too
Signed-off-by: Matthias Kestenholz <mk@spinlock.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 8 Apr 2008 00:11:34 +0000 (17:11 -0700)]
log: teach "terminator" vs "separator" mode to "--pretty=format"
This attached patch introduces a single bit "use_terminator" in "struct
rev_info", which is normally false (i.e. most formats use separator
semantics) but by flipping it to true, you can ask for terminator
semantics just like oneline format does.
The function get_commit_format(), which is what parses "--pretty=" option,
now takes a pointer to "struct rev_info" and updates its commit_format and
use_terminator fields. It used to return the value of type "enum
cmit_fmt", but all the callers assigned it to rev->commit_format.
There are only two cases the code turns use_terminator on. Obviously, the
traditional oneline format (--pretty=oneline) is one of them, and the new
case is --pretty=tformat:... that acts like --pretty=format:... but flips
the bit on.
With this, "--pretty=tformat:%H %s" acts like --pretty=oneline.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Wed, 9 Apr 2008 15:15:51 +0000 (11:15 -0400)]
git-remote: show all remotes with "git remote show"
Many other commands use the "no arguments" form to show a
list (e.g., git-branch, git-tag). While we did show all
remotes for just "git remote", we displayed a usage error
for "git remote show" with no arguments. This is
counterintuitive, since by giving it _more_ information, we
get _less_ result.
The usage model can now be thought of as:
- "git remote show <remote>": show a remote
- "git remote show": show all remotes
- "git remote": assume "show"; i.e., shorthand for "git remote show"
Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 10 Apr 2008 07:47:04 +0000 (00:47 -0700)]
Merge branch 'maint'
* maint:
git-fetch: fix status output when not storing tracking ref
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.
Jeff King [Thu, 10 Apr 2008 00:03:49 +0000 (20:03 -0400)]
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>
Junio C Hamano [Thu, 10 Apr 2008 07:29:33 +0000 (00:29 -0700)]
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.
Carlos Rica [Thu, 10 Apr 2008 00:08:23 +0000 (02:08 +0200)]
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>
René Scharfe [Wed, 9 Apr 2008 21:14:43 +0000 (23:14 +0200)]
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>
Carlos Rica [Wed, 9 Apr 2008 11:07:14 +0000 (13:07 +0200)]
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>
Miklos Vajna [Wed, 2 Apr 2008 19:35:11 +0000 (21:35 +0200)]
contrib/hooks: add an example pre-auto-gc hook
It disables git-gc --auto when you are running Linux and you are
not on AC.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Miklos Vajna [Wed, 2 Apr 2008 19:34:55 +0000 (21:34 +0200)]
Documentation/hooks: add pre-auto-gc hook
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Miklos Vajna [Wed, 2 Apr 2008 19:34:38 +0000 (21:34 +0200)]
git-gc --auto: add pre-auto-gc hook
If such a hook is available and exits with a non-zero status, then
git-gc --auto won't run.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 30 Dec 2007 11:13:27 +0000 (03:13 -0800)]
sha1-lookup: make selection of 'middle' less aggressive
If we pick 'mi' between 'lo' and 'hi' at 50%, which was what the
simple binary search did, we are halving the search space
whether the entry at 'mi' is lower or higher than the target.
The previous patch was about picking not the middle but closer
to 'hi', when we know the target is a lot closer to 'hi' than it
is to 'lo'. However, if it turns out that the entry at 'mi' is
higher than the target, we would end up reducing the search
space only by the difference between 'mi' and 'hi' (which by
definition is less than 50% --- that was the whole point of not
using the simple binary search), which made the search less
efficient. And the risk of overshooting becomes very high, if
we try to be too precise.
This tweaks the selection of 'mi' to be a bit closer to the
middle than we would otherwise pick to avoid the problem.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 13 Feb 2008 01:06:58 +0000 (17:06 -0800)]
diff: make --dirstat binary-file safe
Instead of counting added and removed lines (and mixing the byte size
reported for binary files in the result), summarize the extent of damage
the same way as we count similarity for rename detection.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sat, 29 Dec 2007 10:05:47 +0000 (02:05 -0800)]
sha1-lookup: more memory efficient search in sorted list of SHA-1
Currently, when looking for a packed object from the pack idx, a
simple binary search is used.
A conventional binary search loop looks like this:
unsigned lo, hi;
do {
unsigned mi = (lo + hi) / 2;
int cmp = "entry pointed at by mi" minus "target";
if (!cmp)
return mi; "mi is the wanted one"
if (cmp > 0)
hi = mi; "mi is larger than target"
else
lo = mi+1; "mi is smaller than target"
} while (lo < hi);
"did not find what we wanted"
The invariants are:
- When entering the loop, 'lo' points at a slot that is never
above the target (it could be at the target), 'hi' points at
a slot that is guaranteed to be above the target (it can
never be at the target).
- We find a point 'mi' between 'lo' and 'hi' ('mi' could be
the same as 'lo', but never can be as high as 'hi'), and
check if 'mi' hits the target. There are three cases:
- if it is a hit, we have found what we are looking for;
- if it is strictly higher than the target, we set it to
'hi', and repeat the search.
- if it is strictly lower than the target, we update 'lo'
to one slot after it, because we allow 'lo' to be at the
target and 'mi' is known to be below the target.
If the loop exits, there is no matching entry.
When choosing 'mi', we do not have to take the "middle" but
anywhere in between 'lo' and 'hi', as long as lo <= mi < hi is
satisfied. When we somehow know that the distance between the
target and 'lo' is much shorter than the target and 'hi', we
could pick 'mi' that is much closer to 'lo' than (hi+lo)/2,
which a conventional binary search would pick.
This patch takes advantage of the fact that the SHA-1 is a good
hash function, and as long as there are enough entries in the
table, we can expect uniform distribution. An entry that begins
with for example "
deadbeef..." is much likely to appear much
later than in the midway of a reasonably populated table. In
fact, it can be expected to be near 87% (222/256) from the top
of the table.
This is a work-in-progress and has switches to allow easier
experiments and debugging. Exporting GIT_USE_LOOKUP environment
variable enables this code.
On my admittedly memory starved machine, with a partial KDE
repository (3.0G pack with 95M idx):
$ GIT_USE_LOOKUP=t git log -800 --stat HEAD >/dev/null
3.93user 0.16system 0:04.09elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+55588minor)pagefaults 0swaps
Without the patch, the numbers are:
$ git log -800 --stat HEAD >/dev/null
4.00user 0.15system 0:04.17elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+60258minor)pagefaults 0swaps
In the same repository:
$ GIT_USE_LOOKUP=t git log -2000 HEAD >/dev/null
0.12user 0.00system 0:00.12elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+4241minor)pagefaults 0swaps
Without the patch, the numbers are:
$ git log -2000 HEAD >/dev/null
0.05user 0.01system 0:00.07elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+8506minor)pagefaults 0swaps
There isn't much time difference, but the number of minor faults
seems to show that we are touching much smaller number of pages,
which is expected.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 9 Apr 2008 07:46:40 +0000 (00:46 -0700)]
Merge branch 'jc/rename'
* 'jc/rename' (early part):
Optimize rename detection for a huge diff
Junio C Hamano [Wed, 9 Apr 2008 07:44:48 +0000 (00:44 -0700)]
Merge branch 'gp/gitweb'
* gp/gitweb:
gitweb: fallback to system-wide config file (fixup)
gitweb: fallback to system-wide config file if default config does not exist
Junio C Hamano [Wed, 9 Apr 2008 07:44:17 +0000 (00:44 -0700)]
Merge branch 'mk/unpack-careful'
* mk/unpack-careful:
t5300: add test for "index-pack --strict"
receive-pack: allow using --strict mode for unpacking objects
unpack-objects: fix --strict handling
t5300: add test for "unpack-objects --strict"
unpack-objects: prevent writing of inconsistent objects
Junio C Hamano [Wed, 9 Apr 2008 07:42:23 +0000 (00:42 -0700)]
Merge branch 'fl/send-email-outside'
* fl/send-email-outside:
send-email: Don't require to be called in a repository
Git.pm: Don't require repository instance for ident
Git.pm: Don't require a repository instance for config
var: Don't require to be in a git repository.
Junio C Hamano [Wed, 9 Apr 2008 07:40:46 +0000 (00:40 -0700)]
Merge branch 'jc/rebase'
* jc/rebase:
rebase [--onto O] A B: omit needless checkout
Junio C Hamano [Wed, 9 Apr 2008 07:29:24 +0000 (00:29 -0700)]
Merge branch 'jk/add-i-mode'
* jk/add-i-mode:
add--interactive: allow user to choose mode update
add--interactive: ignore mode change in 'p'atch command
Junio C Hamano [Wed, 9 Apr 2008 07:18:25 +0000 (00:18 -0700)]
Merge branch 'gs/pretty-hexval'
* gs/pretty-hexval:
pretty.c: add %x00 format specifier.
Junio C Hamano [Tue, 8 Apr 2008 04:57:43 +0000 (21:57 -0700)]
GIT 1.5.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 8 Apr 2008 04:52:23 +0000 (21:52 -0700)]
Merge git://git.kernel.org/pub/scm/gitk/gitk
* git://git.kernel.org/pub/scm/gitk/gitk:
gitk: Fix changing colors through Edit->Preferences
Eric Wong [Mon, 7 Apr 2008 07:08:03 +0000 (00:08 -0700)]
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>
Junio C Hamano [Mon, 7 Apr 2008 03:04:29 +0000 (20:04 -0700)]
Merge branch 'jc/maint-apply-match-beginning'
* jc/maint-apply-match-beginning:
Fix "git apply" to correctly enforce "match at the beginning"
Pascal Obry [Sun, 6 Apr 2008 16:56:08 +0000 (18:56 +0200)]
Add prefix oriented completions for diff and format-patch commands.
Signed-off-by: Pascal Obry <pascal@obry.net>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder [Sun, 6 Apr 2008 17:08:50 +0000 (19:08 +0200)]
test suite: remove useless TERM cruft in "t7005-editor.sh"
In commit
15387e3 (Test suite: reset TERM to its previous value after
testing., 2007-10-26), I added a workaround to reset TERM to its previous
value before the "test_done" at the end of "t7005-editor.sh" because
otherwise "test_done" would have printed the test result with a bad TERM
env variable (this resulted in output with no color on konsole).
But since commit
c2116a1 (test-lib: fix TERM to dumb for test
repeatability, 2008-03-06), colored output is printed in a subshell with
TERM reset to its original value so the earlier workaround is not needed
anymore.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Pascal Obry [Sun, 6 Apr 2008 17:32:24 +0000 (19:32 +0200)]
Add interactive option in rebase command completion list.
Signed-off-by: Pascal Obry <pascal@obry.net>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Mon, 7 Apr 2008 02:21:45 +0000 (19:21 -0700)]
Fix "git apply" to correctly enforce "match at the beginning"
An earlier commit
4be6096 (apply --unidiff-zero: loosen sanity checks for
--unidiff=0 patches, 2006-09-17) made match_beginning and match_end
computed incorrectly. If a hunk inserts at the beginning, old position
recorded at the hunk is line 0, and if a hunk changes at the beginning, it
is line 1. The new test added to t4104 exposes that the old code did not
insist on matching at the beginning for a patch to add a line to an empty
file.
An even older
65aadb9 (apply: force matching at the beginning.,
2006-05-24) was equally wrong in that it tried to take hints from the
number of leading context lines, to decide if the hunk must match at the
beginning, but we can just look at the line number in the hunk to decide.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Peter Eriksen [Sun, 6 Apr 2008 20:51:49 +0000 (22:51 +0200)]
Add description of OFS_DELTA to the pack format description
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Gerrit Pape [Wed, 26 Mar 2008 18:45:26 +0000 (18:45 +0000)]
gitk: Fix changing colors through Edit->Preferences
With tcl/tk8.5 the lset command seems to behave differently. When
changing the background color through Edit->Preferences, the changes
are applied, but new dialogs, such as View->New view... barf with
Error: unknown color name "{#ffffff}"
Additionally when closing gitk, and starting it up again, a bad value
has been saved to ~/.gitk, preventing gitk from running properly; it
fails with
Error in startup script: unknown color name "{#ffffff}"
...
This commit fixes the problem by changing the color dialogs to pass
the empty string {} as the list index to choosecolor. This causes
the lset and lindex commands used by choosecolor to use and set the
whole variable (bgcolor, fgcolor or selectbgcolor) rather than
treating them as a 1-element list. Tested with tcl/tk8.4 and 8.5.
Dmitry Potapov reported this problem through
http://bugs.debian.org/472615
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Peter Eriksen [Sat, 5 Apr 2008 19:46:49 +0000 (21:46 +0200)]
git-pack-objects.txt: Make wording slightly less ambiguous
It is a bit confusing on first read, that
"The packed archive format (.pack) is designed
to be unpackable..."
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Kevin Ballard [Sat, 5 Apr 2008 18:28:53 +0000 (14:28 -0400)]
git-fetch: Don't trigger a bus error when given the refspec "tag"
When git-fetch encounters the refspec "tag" it assumes that the next
argument will be a tag name. If there is no next argument, it should
die gracefully instead of erroring.
Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jakub Narebski [Sat, 5 Apr 2008 20:13:24 +0000 (21:13 +0100)]
Revert "gitweb: Add 'status_str' to parse_difftree_raw_line output"
This reverts commit
6aa6f92fda47cc4ee5f599895e8a5a327fb6f9ab.
It caused is_deleted() subroutine to output warnings when dealing with
old, legacy gitweb blobdiff URLs without either 'hb' or 'hpb'
parameters.
This fixes http://bugs.debian.org/469083
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Gerrit Pape [Sat, 5 Apr 2008 16:37:18 +0000 (16:37 +0000)]
gitweb: fallback to system-wide config file (fixup)
The earlier one did not correctly propagate GITWEB_CONFIG_SYSTEM from
Makefile to generated gitweb.cgi script.
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sat, 5 Apr 2008 05:38:32 +0000 (22:38 -0700)]
Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui:
git-gui: use +/- instead of ]/[ to show more/less context in diff
git-gui: Update french translation
git-gui: Switch keybindings for [ and ] to bracketleft and bracketright
Michele Ballabio [Fri, 4 Apr 2008 21:04:42 +0000 (23:04 +0200)]
git-gui: use +/- instead of ]/[ to show more/less context in diff
On some systems, brackets cannot be used as event details
(they don't have a keysym), so use +/- instead (both on
keyboard and keypad) and add ctrl-= as a synonym of ctrl-+
for convenience.
[sp: Had to change accelerator to show only "$M1T-="; the
original version included "$M1T-+ $M1T-=" but this is
not drawn at all on Mac OS X.]
Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Christian Couder [Sat, 5 Apr 2008 02:20:23 +0000 (04:20 +0200)]
git-gui: Update french translation
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>