1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-31 22:37:54 +01:00
Commit graph

18354 commits

Author SHA1 Message Date
Junio C Hamano
ef5542ca93 Merge branch 'eb/upload-archive-from-git-shell'
* eb/upload-archive-from-git-shell:
  git-shell: Add 'git-upload-archive' to allowed commands.
2009-04-17 21:42:12 -07:00
Junio C Hamano
1dd9b638c1 Merge branch 'jc/shared-literally'
* jc/shared-literally:
  t1301-shared-repo: fix forced modes test
2009-04-17 21:42:12 -07:00
Junio C Hamano
1ee28e58d5 Merge branch 'ns/am-to-empty'
* ns/am-to-empty:
  git-am: teach git-am to apply a patch to an unborn branch
2009-04-17 21:42:12 -07:00
Junio C Hamano
a9b772a011 Merge branch 'bw/short-ref-strict'
* bw/short-ref-strict:
  remote.c: use shorten_unambiguous_ref
  rev-parse: --abbrev-ref option to shorten ref name
  for-each-ref: utilize core.warnAmbiguousRefs for :short-format
  shorten_unambiguous_ref(): add strict mode
2009-04-17 21:42:12 -07:00
Junio C Hamano
bd15ef078a Merge branch 'da/difftool'
* da/difftool:
  mergetool--lib: simplify API usage by removing more global variables
  Fix misspelled mergetool.keepBackup
  difftool/mergetool: refactor commands to use git-mergetool--lib
  mergetool: use $( ... ) instead of `backticks`
  bash completion: add git-difftool
  difftool: add support for a difftool.prompt config variable
  difftool: add various git-difftool tests
  difftool: move 'git-difftool' out of contrib
  difftool/mergetool: add diffuse as merge and diff tool
  difftool: add a -y shortcut for --no-prompt
  difftool: use perl built-ins when testing for msys
  difftool: remove the backup file feature
  difftool: remove merge options for opendiff, tkdiff, kdiff3 and xxdiff
  git-mergetool: add new merge tool TortoiseMerge
  git-mergetool/difftool: make (g)vimdiff workable under Windows
  doc/merge-config: list ecmerge as a built-in merge tool
2009-04-17 21:42:12 -07:00
Junio C Hamano
2d430c7133 Merge branch 'maint'
* maint:
  doc/gitattributes: clarify location of config text
  Fix buffer overflow in config parser
  git-apply: fix option description
2009-04-17 21:29:15 -07:00
Jeff King
c4c86d2389 doc/gitattributes: clarify location of config text
The gitattributes documentation has a section on the "diff"
attribute, with subsections for each of the things you might
want to configure in your diff config section (external
diff, hunk headers, etc). The first such subsection
specifically notes that the definition of the diff driver
should go into $GIT_DIR/config, but subsequent sections do
not.

This location is implied if you are reading the
documentation sequentially, but it is not uncommon for a new
user to jump to (or be referred to) a specific section. For
a new user who does not know git well enough to recognize
the config syntax, it is not clear that those directives
don't also go into the gitattributes file.

This patch just mentions the config file in each subsection,
similar to the way it is mentioned in the first.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-17 21:28:07 -07:00
Pierre Habouzit
aed97c677c hook/update: example of how to prevent branch creation
Since git doesn't provide a receive.denyBranchCreation or similar, here is
an example of how to be sure users cannot create branches remotely by
pushing a new reference.

This setup has been proven useful to prevent creation of spurious branches
because of users having their remote.origin.push set to HEAD, when they
use `git push` while being on a local topic branch of theirs instead of
the proper one.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-17 21:26:11 -07:00
Junio C Hamano
f7446fc6bb Merge branch 'maint-1.6.1' into maint
* maint-1.6.1:
  Fix buffer overflow in config parser
2009-04-17 21:20:58 -07:00
Junio C Hamano
0fa0514b91 Merge branch 'maint-1.6.0' into maint-1.6.1
* maint-1.6.0:
  Fix buffer overflow in config parser
2009-04-17 21:06:11 -07:00
Thomas Jarosch
e0b3cc0dff Fix buffer overflow in config parser
When interpreting a config value, the config parser reads in 1+ space
character(s) and puts -one- space character in the buffer as soon as
the first non-space character is encountered (if not inside quotes).

Unfortunately the buffer size check lacks the extra space character
which gets inserted at the next non-space character, resulting in
a crash with a specially crafted config entry.

The unit test now uses Java to compile a platform independent
.NET framework to output the test string in C# :o)

    Read: Thanks to Johannes Sixt for the correct printf call
    which replaces the perl invocation.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-17 20:59:01 -07:00
Michael J Gruber
45972ffbed remote.c: use shorten_unambiguous_ref
Use the new shorten_unambiguous_ref() for simplifying the output of
upstream branch names. This affects status and checkout.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-17 20:53:19 -07:00
Nguyễn Thái Ngọc Duy
55f0566f6d get_local_heads(): do not return random pointer if there is no head
it's silly to do this:

mkdir foo && cd foo && git init && git push somewhere.git

but segfault should not happen even in that case.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-17 20:48:32 -07:00
Ulrich Windl
ae57ec223b git-apply: fix option description
Do not use non ASCII single quote.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-16 16:32:17 -07:00
Bert Wesarg
a45d34691e rev-parse: --abbrev-ref option to shorten ref name
This applies the shorten_unambiguous_ref function to the object name.
Default mode is controlled by core.warnAmbiguousRefs. Else it is given as
optional argument to --abbrev-ref={strict|loose}.

This should be faster than 'git for-each-ref --format="%(refname:short)" <ref>'
for single refs.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-13 09:42:55 -07:00
Bert Wesarg
2bb98169be for-each-ref: utilize core.warnAmbiguousRefs for :short-format
core.warnAmbiguousRefs is used to select strict mode for the
abbreviation for the ":short" format specifier of "refname" and "upstream".

In strict mode, the abbreviated ref will never trigger the
'warn_ambiguous_refs' warning. I.e. for these refs:

  refs/heads/xyzzy
  refs/tags/xyzzy

the abbreviated forms are:

  heads/xyzzy
  tags/xyzzy

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-13 09:36:52 -07:00
Bert Wesarg
6e7b3309d3 shorten_unambiguous_ref(): add strict mode
Add the strict mode of abbreviation to shorten_unambiguous_ref(), i.e. the
resulting ref won't trigger the ambiguous ref warning.

All users of shorten_unambiguous_ref() still use the loose mode.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-13 09:36:44 -07:00
Junio C Hamano
f800b65bea gitignore git-bisect--helper
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-12 21:15:59 -07:00
Nanako Shiraishi
f79d4c8a0f git-am: teach git-am to apply a patch to an unborn branch
People sometimes wonder why they cannot apply a patch that only
creates new files to an unborn branch.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-12 18:42:15 -07:00
Junio C Hamano
7d5a1806e8 Mark t1301 permission test to depend on POSIXPERM
This prepares the topic for inclusion to master.
2009-04-12 17:56:25 -07:00
Junio C Hamano
c965c02933 GIT 1.6.3-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-12 17:05:55 -07:00
Nanako Shiraishi
54a47493a3 Documentation/git.txt: GIT 1.6.2.2 has been out for a while
These links inside "stalenotes" section need to be updated on the master
branch every time a new stable or maintenance release is made.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-12 17:04:17 -07:00
Junio C Hamano
6f523f6d38 Merge branch 'jk/no-perl'
* jk/no-perl:
  tests: skip perl tests if NO_PERL is defined
  Makefile: allow building without perl
2009-04-12 16:46:42 -07:00
Junio C Hamano
c736becc94 Merge branch 'sb/doc-upstream-branch'
* sb/doc-upstream-branch:
  Documentation: Introduce "upstream branch"
2009-04-12 16:46:42 -07:00
Junio C Hamano
3e52effcf6 Merge branch 'jk/show-upstream'
* jk/show-upstream:
  branch: show upstream branch when double verbose
  make get_short_ref a public function
  for-each-ref: add "upstream" format field
  for-each-ref: refactor refname handling
  for-each-ref: refactor get_short_ref function
2009-04-12 16:46:42 -07:00
Junio C Hamano
c276857ee2 Merge branch 'fg/remote-prune'
* fg/remote-prune:
  add tests for remote groups
  git remote update: Fallback to remote if group does not exist
  remote: New function remote_is_configured()
  git remote update: Report error for non-existing groups
  git remote update: New option --prune
  builtin-remote.c: Split out prune_remote as a separate function.
2009-04-12 16:46:41 -07:00
Junio C Hamano
07fb030efc Merge branch 'cc/sha1-bsearch'
* cc/sha1-bsearch:
  sha1-lookup: fix up the assertion message
2009-04-12 16:46:41 -07:00
Junio C Hamano
6e353a5e5d Merge branch 'cc/bisect-filter'
* cc/bisect-filter: (21 commits)
  rev-list: add "int bisect_show_flags" in "struct rev_list_info"
  rev-list: remove last static vars used in "show_commit"
  list-objects: add "void *data" parameter to show functions
  bisect--helper: string output variables together with "&&"
  rev-list: pass "int flags" as last argument of "show_bisect_vars"
  t6030: test bisecting with paths
  bisect: use "bisect--helper" and remove "filter_skipped" function
  bisect: implement "read_bisect_paths" to read paths in "$GIT_DIR/BISECT_NAMES"
  bisect--helper: implement "git bisect--helper"
  bisect: use the new generic "sha1_pos" function to lookup sha1
  rev-list: call new "filter_skip" function
  patch-ids: use the new generic "sha1_pos" function to lookup sha1
  sha1-lookup: add new "sha1_pos" function to efficiently lookup sha1
  rev-list: pass "revs" to "show_bisect_vars"
  rev-list: make "show_bisect_vars" non static
  rev-list: move code to show bisect vars into its own function
  rev-list: move bisect related code into its own file
  rev-list: make "bisect_list" variable local to "cmd_rev_list"
  refs: add "for_each_ref_in" function to refactor "for_each_*_ref" functions
  quote: add "sq_dequote_to_argv" to put unwrapped args in an argv array
  ...
2009-04-12 16:46:40 -07:00
Junio C Hamano
a54c4edc51 Merge branch 'maint'
* maint:
  GIT 1.6.2.3
  State the effect of filter-branch on graft explicitly
  process_{tree,blob}: Remove useless xstrdup calls

Conflicts:
	GIT-VERSION-GEN
2009-04-12 16:01:25 -07:00
Junio C Hamano
3bd1bb327e GIT 1.6.2.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-12 15:57:58 -07:00
Junio C Hamano
1966af8176 Merge branch 'maint-1.6.1' into maint
* maint-1.6.1:
  State the effect of filter-branch on graft explicitly
  process_{tree,blob}: Remove useless xstrdup calls
2009-04-12 15:34:53 -07:00
Junio C Hamano
bc69776aa1 Merge branch 'maint-1.6.0' into maint-1.6.1
* maint-1.6.0:
  State the effect of filter-branch on graft explicitly
  process_{tree,blob}: Remove useless xstrdup calls
2009-04-12 15:20:29 -07:00
David Aguilar
47d65924a6 mergetool--lib: simplify API usage by removing more global variables
The mergetool--lib scriplet was tricky to use because it relied upon
the existance of several global shell variables.  This removes more
global variables so that things are simpler for callers.

A side effect is that some variables are recomputed each time
run_merge_tool() is called, but the overhead for recomputing
them is justified by the simpler implementation.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-12 15:19:12 -07:00
Daniel Cheng (aka SDiZ)
c6d8f7635f State the effect of filter-branch on graft explicitly
Signed-off-by: Daniel Cheng (aka SDiZ) <j16sdiz+freenet@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-12 14:30:40 -07:00
Linus Torvalds
213152688c process_{tree,blob}: Remove useless xstrdup calls
On Wed, 8 Apr 2009, Björn Steinbrink wrote:
>
> The name of the processed object was duplicated for passing it to
> add_object(), but that already calls path_name, which allocates a new
> string anyway. So the memory allocated by the xstrdup calls just went
> nowhere, leaking memory.

Ack, ack.

There's another easy 5% or so for the built-in object walker: once we've
created the hash from the name, the name isn't interesting any more, and
so something trivial like this can help a bit.

Does it matter? Probably not on its own. But a few more memory saving
tricks and it might all make a difference.

		Linus

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-12 14:30:31 -07:00
Johannes Sixt
078688213f t1301-shared-repo: fix forced modes test
This test was added recently (5a688fe, "core.sharedrepository = 0mode"
should set, not loosen; 2009-03-28). It checked the result of a sed
invocation for emptyness, but in some cases it forgot to print anything
at all, so that those checks would never be false.

Due to this mistake, it went unnoticed that the files in objects/info are
not necessarily 0440, but can also be 0660.  Because the 0mode setting
tries to guarantee that the files are accessible only to the people they
are meant to be used by, we should only make sure that they are readable
by the user and the group when the configuration is set to 0660.  It is a
separate matter from the core.shredrepository settings that w-bit from
immutable object files under objects/[0-9a-f][0-9a-f] directories should
be dropped.

COMMIT_EDITMSG is still world-readable, but it (and any transient files
that are meant for repositories with a work tree) does not matter.  If you
are working on a shared machine and on a sekrit stuff, the root of the
work tree would be with mode 0700 (or 0750 to allow peeking by other
people in the group), and that would mean that .git/COMMIT_EDITMSG in such
a repository would not be readable by the strangers anyway.

Also, in the real-world use case, .git/COMMIT_EDITMSG will be given to an
arbitrary editor the user happens to use, and we have no guarantee what it
does (e.g. it may create a new file with umask and replace, it may rewrite
in place, it may leave an editor backup file but use umask to create it,
etc.), and the protection of the file lies majorly on the protection of
the root of the work tree.

This test cannot be run on Windows; it requires POSIXPERM when merged to
'master'.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-12 13:34:06 -07:00
Ben Walton
ee7ec2f9de documentation: Makefile accounts for SHELL_PATH setting
Ensure that the Makefile that generates and installs the Documentation is
aware of any SHELL_PATH setting.  Use this value if found or the current
setting for SHELL if not.  This is an accommodation for systems where sh
is not POSIX enough.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-12 01:35:12 -07:00
Linus Torvalds
cced5fbc24 Allow users to un-configure rename detection
I told people on the kernel mailing list to please use "-M" when sending
me rename patches, so that I can see what they do while reading email
rather than having to apply the patch and then look at the end result.

I also told them that if they want to make it the default, they can just
add

	[diff]
		renames

to their ~/.gitconfig file. And while I was thinking about that, I wanted
to also check whether you can then mark individual projects to _not_ have
that default in the per-repository .git/config file.

And you can't. Currently you cannot have a global "enable renames by
default" and then a local ".. but not for _this_ project". Why? Because if
somebody writes

	[diff]
		renames = no

we simply ignore it, rather than resetting "diff_detect_rename_default"
back to zero.

Fixed thusly.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-11 22:22:00 -07:00
Mike Hommey
519d05be90 Replace ",<,>,& with their respective XML entities in DAV requests
If the repo url or the user email contain XML special characters, the
remote DAV server is likely to reject the LOCK requests because the XML
is then malformed.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-11 22:21:59 -07:00
Johannes Schindelin
d3c9634eac git-svn: always initialize with core.autocrlf=false
It has been reported time and time again in relation to msysGit that
git-svn does not work well when core.autocrlf has any value other than
'false'.  So let's make it so by default.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-11 22:21:59 -07:00
Dan McGee
b6c29915d2 Update delta compression message to be less misleading
In the case of a small repository, pack-objects is smart enough to not
start more threads than necessary. However, the output to the user always
reports the value of the pack.threads configuration and not the real
number of threads to be used.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-11 22:21:59 -07:00
Ben Jackson
88ec205477 git-svn: Save init/clone --ignore-paths in config
The --ignored-paths argument is now stored as
"svn-remote.$REMOTE_NAME.ignore-paths" in the config file.

[ew: edited subject and message]
Signed-off-by: Ben Jackson <ben@ben.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-04-11 17:55:37 -07:00
Ben Jackson
0d8bee71af git-svn: Add per-svn-remote ignore-paths config
The --ignore-paths option to fetch is very useful for working on a subset
of a SVN repository.  For proper operation, every command that causes a
fetch (explicit or implied) must include a matching --ignore-paths option.

This patch adds a persistent svn-remote.$repo_id.ignore-paths config by
promoting Fetcher::is_path_ignored to a member function and initializing
$self->{ignore_regex} in Fetcher::new.  Command line --ignore-paths is
still recognized and acts in addition to the config value.

Signed-off-by: Ben Jackson <ben@ben.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-04-11 17:55:37 -07:00
Boris Byk
6ea4203288 git-svn: speed up blame command
'git svn blame' now uses the 'git cat-file --batch' command to
speed up resolving SVN revision number out of commit SHA by
removing fork+exec overhead.

[ew: enforced 80-column line wrap]

Signed-off-by: Boris Byk <boris.byk@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-04-11 17:55:04 -07:00
Jason Merrill
c2abd83fea git-svn: add fetch --parent option
Signed-off-by: Jason Merrill <jason@redhat.com>
Acked-By: Eric Wong <normalperson@yhbt.net>
2009-04-11 17:53:52 -07:00
Ferry Huberts
70af4e9bef Fix misspelled mergetool.keepBackup
In several places mergetool.keepBackup was misspelled as merge.keepBackup.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-11 12:20:17 -07:00
Erik Broes
79f72b9763 git-shell: Add 'git-upload-archive' to allowed commands.
This allows for example gitosis to allow use of 'git archive --remote' in a
controlled environment.

Signed-off-by: Erik Broes <erikbroes@ripe.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-11 11:01:15 -07:00
Jeff King
27845e9548 add tests for remote groups
This tries to systematically cover existing behavior, and
also mark some expect_failure cases for desired behavior.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-09 01:30:06 -07:00
Junio C Hamano
e37347bba6 Update draft release notes to 1.6.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-09 00:04:55 -07:00
Junio C Hamano
796b13781a Merge branch 'maint'
* maint:
  Start 1.6.2.3 preparation
  process_{tree,blob}: Remove useless xstrdup calls
  git-pull.sh: better warning message for "git pull" on detached head.

Conflicts:
	RelNotes
2009-04-08 23:47:23 -07:00