Commit graph

15932 commits

Author SHA1 Message Date
Junio C Hamano 8b1981d32b Merge branch 'ar/maint-mksnpath' into maint
* ar/maint-mksnpath:
  Use git_pathdup instead of xstrdup(git_path(...))
  git_pathdup: returns xstrdup-ed copy of the formatted path
  Fix potentially dangerous use of git_path in ref.c
  Add git_snpath: a .git path formatting routine with output buffer
  Fix potentially dangerous uses of mkpath and git_path
  Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c
  Add mksnpath which allows you to specify the output buffer

Conflicts:
	builtin-revert.c
	rerere.c
2008-11-08 16:13:19 -08:00
Junio C Hamano 3b8572a429 Merge branch 'mv/maint-branch-m-symref' into maint
* mv/maint-branch-m-symref:
  update-ref --no-deref -d: handle the case when the pointed ref is packed
  git branch -m: forbid renaming of a symref
  Fix git update-ref --no-deref -d.
  rename_ref(): handle the case when the reflog of a ref does not exist
  Fix git branch -m for symrefs.
2008-11-08 16:07:37 -08:00
Junio C Hamano 16088d8870 format-patch documentation: mention the special case of showing a single commit
Even long timers seem to have missed that "format-patch -1 $commit" is a
much simpler and more obvious way to say "format-patch $commit^..$commit"
from the current documentation (and an example "format-patch -3 $commit"
to get three patches).  Add an explicit instruction in a much earlier part
of the documentation to make it easier to find.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-02 20:45:55 -08:00
Yann Dirson a5a323f33c Add reference for status letters in documentation.
Also fix error in diff_filepair::status documentation, and point to
the in-code reference as well as the doc.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-02 15:57:10 -08:00
Mikael Magnusson 7756ba74c0 Document that git-log takes --all-match.
Signed-off-by: Mikael Magnusson <mikachu@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-02 15:51:37 -08:00
Junio C Hamano 02893a8503 Update draft 1.6.0.4 release notes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-02 14:35:41 -08:00
Junio C Hamano f6276b788f Merge branch 'js/maint-fetch-update-head' into maint
* js/maint-fetch-update-head:
  pull: allow "git pull origin $something:$current_branch" into an unborn branch
  Fix fetch/pull when run without --update-head-ok
2008-11-02 13:37:16 -08:00
Junio C Hamano 86e67a088c Merge branch 'jk/maint-ls-files-other' into maint
* jk/maint-ls-files-other:
  refactor handling of "other" files in ls-files and status
2008-11-02 13:37:13 -08:00
Junio C Hamano d11ddaff02 Merge branch 'jc/maint-reset-remove-unmerged-new' into maint
* jc/maint-reset-remove-unmerged-new:
  reset --hard/read-tree --reset -u: remove unmerged new paths
2008-11-02 13:36:20 -08:00
Junio C Hamano 581000a419 Merge branch 'jc/maint-co-track' into maint
* jc/maint-co-track:
  Enhance hold_lock_file_for_{update,append}() API
  demonstrate breakage of detached checkout with symbolic link HEAD
  Fix "checkout --track -b newbranch" on detached HEAD
2008-11-02 13:36:14 -08:00
Junio C Hamano 1a9016aae5 Start 1.6.0.4 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-02 00:14:04 -07:00
Tom Preston-Werner c2163c6aa2 add instructions on how to send patches to the mailing list with Gmail
Gmail is one of the most popular email providers in the world. Now that Gmail
supports IMAP, sending properly formatted patches via `git imap-send` is
trivial. This section in SubmittingPatches explains how to do so.

Signed-off-by: Tom Preston-Werner <tom@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-01 23:48:52 -07:00
Jakub Narebski 4f73e240f9 Documentation/gitattributes: Add subsection header for each attribute
This makes attributes easier to find; before this patch some
attributes had individual subsections, and some didn't.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-01 23:48:48 -07:00
Pierre Habouzit 8c17868795 git send-email: avoid leaking directory file descriptors.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-01 23:48:45 -07:00
Jeff King 30affa1e9a send-pack: do not send out single-level refs such as refs/stash
Since no version of receive-pack accepts these "funny refs", we should
mirror the check when considering the list of refs to send. IOW, don't
even make them eligible for matching or mirroring.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-01 23:48:39 -07:00
Jeff King 1442171bc9 fix overlapping memcpy in normalize_absolute_path
The comments for normalize_absolute_path explicitly claim
that the source and destination buffers may be the same
(though they may not otherwise overlap). Thus the call to
memcpy may involve copying overlapping data, and memmove
should be used instead.

This fixes a valgrind error in t1504.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-01 23:46:53 -07:00
Jeff King 421b488a58 pack-objects: avoid reading uninitalized data
In the main loop of find_deltas, we do:

  struct object_entry *entry = *list++;
  ...
  if (!*list_size)
	  ...
	  break

Because we look at and increment *list _before_ the check of
list_size, in the very last iteration of the loop we will
look at uninitialized data, and increment the pointer beyond
one past the end of the allocated space. Since we don't
actually do anything with the data until after the check,
this is not a problem in practice.

But since it technically violates the C standard, and
because it provokes a spurious valgrind warning, let's just
move the initialization of entry to a safe place.

This fixes valgrind errors in t5300, t5301, t5302, t303, and
t9400.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-01 23:46:40 -07:00
Jeff King 13494ed14c correct cache_entry allocation
Most cache_entry structs are allocated by using the
cache_entry_size macro, which rounds the size of the struct
up to the nearest multiple of 8 bytes (presumably to avoid
memory fragmentation).

There is one exception: the special "conflict entry" is
allocated with an empty name, and so is explicitly given
just one extra byte to hold the NUL.

However, later code doesn't realize that this particular
struct has been allocated differently, and happily tries
reading and copying it based on the ce_size macro, which
assumes the 8-byte alignment.

This can lead to reading uninitalized data, though since
that data is simply padding, there shouldn't be any problem
as a result. Still, it makes sense to hold the padding
assumption so as not to surprise later maintainers.

This fixes valgrind errors in t1005, t3030, t4002, and
t4114.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-01 23:46:34 -07:00
Junio C Hamano faf1dc7223 Merge branch 'maint' of git://repo.or.cz/git-gui into maint
* 'maint' of git://repo.or.cz/git-gui:
  git-gui: Help identify aspell version on Windows too
2008-11-01 22:31:14 -07:00
Miklos Vajna 045a476f91 update-ref --no-deref -d: handle the case when the pointed ref is packed
In this case we did nothing in the past, but we should delete the
reference in fact.

The problem was that when the symref is not packed but the referenced
ref is packed, then we assumed that the symref is packed as well, but
symrefs are never packed.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-31 22:41:55 -07:00
Deskin Miller e855bfc040 git-svn: change dashed git-commit-tree to git commit-tree
Signed-off-by: Deskin Miller <deskinm@umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-31 01:22:48 -07:00
Jan Krüger 2c850f1221 Documentation: clarify information about 'ident' attribute
The documentation spoke of the attribute being set "to" a path; this can
mistakenly be interpreted as "the attribute needs to have its value set to
some kind of path". This clarifies things.

Signed-off-by: Jan Krüger <jk@jk.gs>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-31 01:07:10 -07:00
Markus Heidelberg 41d8cf7d7f bash completion: add doubledash to "git show"
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-31 00:46:27 -07:00
Alex Riesen 111539a3c7 Use test-chmtime -v instead of perl in t5000 to get mtime of a file
The test was broken on admittedly broken combination of Windows, Cygwin,
and ActiveState Perl.

Signed-off-by: Alex Riesen <ariesen@harmanbecker.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-31 00:34:41 -07:00
Alex Riesen 0ea9ca07aa Add --verbose|-v to test-chmtime
This allows us replace perl when getting the mtime of a file because
of time zone conversions, though at the moment only one platform which
does this has been identified: Cygwin when used with ActiveState Perl
(as usual).

The output format is:

    <mtime1> TAB <filename1> <LF>
    <mtime2> TAB <filename2> <LF>
    ...

which, if only mtime is needed can be parsed with cut(1):

    test-chmtime -v +0 filename1 | cut -f 1

Also, the change adds a description of programs features, with examples.

Signed-off-by: Alex Riesen <ariesen@harmanbecker.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-31 00:19:52 -07:00
Jonas Fonseca 9b6f84d2c2 asciidoc: add minor workaround to add an empty line after code blocks
Insert an empty <simpara> in manpages after code blocks to force and
empty line.

The problem can be seen on the manpage for the git tutorial, where an
example command and the following paragraph is printed with no empty
line between them:

     First, note that you can get documentation for a command such as git
     log --graph with:

         $ man git-log
     It is a good idea to introduce yourself to git [...]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-30 23:41:28 -07:00
Alex Riesen a4f34cbb4c Use git_pathdup instead of xstrdup(git_path(...))
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-30 17:52:24 -07:00
Alex Riesen aba13e7c05 git_pathdup: returns xstrdup-ed copy of the formatted path
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-30 17:30:55 -07:00
Alex Riesen 958a4789e0 Fix potentially dangerous use of git_path in ref.c
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-30 17:18:29 -07:00
Alex Riesen fe2d7776d5 Add git_snpath: a .git path formatting routine with output buffer
The function's purpose is to replace git_path where the buffer of
formatted path may not be reused by subsequent calls of the function
or will be copied anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-30 17:00:14 -07:00
Alex Riesen d258b25887 Plug a memleak in builtin-revert
Probably happened when working around git_path's problem with returned
buffer being reused.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-30 14:01:00 -07:00
Miklos Vajna fa58186c9b git branch -m: forbid renaming of a symref
There may be cases where one would really want to rename the symbolic
ref without changing its value, but "git branch -m" is not such a
use-case.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-30 13:50:48 -07:00
Linus Torvalds 6e381d3aff Add file delete/create info when we overflow rename_limit
When we refuse to do rename detection due to having too many files
created or deleted, let the user know the numbers.  That way there is a
reasonable starting point for setting the diff.renamelimit option.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-28 08:58:42 -07:00
Nanako Shiraishi 1df2a1ce80 Install git-cvsserver in $(bindir)
It is one of the server side programs and needs to be found on usual $PATH.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-28 08:57:08 -07:00
Tommi Virtanen 18378655be Install git-shell in bindir, too
/etc/passwd shell field must be something execable, you can't enter
"/usr/bin/git shell" there. git-shell must be present as a separate
executable, or it is useless.

Signed-off-by: Tommi Virtanen <tv@eagain.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-28 08:56:47 -07:00
Alex Riesen 9fa03c177f Fix potentially dangerous uses of mkpath and git_path
Replace them with mksnpath/git_snpath and a local buffer
for the resulting string.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-26 22:10:28 -07:00
Alex Riesen 94cc355287 Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c
Otherwise the function sometimes fail to resolve obviously correct
refnames, because the string data pointed to by "str" argument were
reused.

The change in dwim_log does not fix anything, just optimizes away
strcpy code as the path can be created directly in the available
buffer.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-26 22:10:28 -07:00
Alex Riesen 108bebeab3 Add mksnpath which allows you to specify the output buffer
This is just vsnprintf's but additionally calls cleanup_path() on the
result. To be used as alternatives to mkpath() where the buffer for the
created path may not be reused by subsequent calls of the same formatting
function.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-26 22:08:58 -07:00
Thomas Rast 9fe7a643fc add -p: warn if only binary changes present
Current 'git add -p' will say "No changes." if there are no changes to
text files, which can be confusing if there _are_ changes to binary
files.  Add some code to distinguish the two cases, and give a
different message in the latter one.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-26 16:20:24 -07:00
Charles Bailey ddff856351 git-archive: work in bare repos
This moves the call to git_config to a place where it doesn't break the
logic for using git archive in a bare repository but retains the fix to
make git archive respect core.autocrlf.

Tests are by René Scharfe.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Tested-by: Deskin Miller <deskinm@umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-26 16:19:59 -07:00
Miklos Vajna 569740bdd0 Fix git update-ref --no-deref -d.
Till now --no-deref was just ignored when deleting refs, fix this.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-26 14:44:25 -07:00
Miklos Vajna 450d4c0f5a rename_ref(): handle the case when the reflog of a ref does not exist
We tried to check if a reflog of a ref is a symlink without first
checking if it exists, which is a bug.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-26 14:43:26 -07:00
Miklos Vajna eca35a25a9 Fix git branch -m for symrefs.
This had two problems with symrefs. First, it copied the actual sha1
instead of the "pointer", second it failed to remove the old ref after a
successful rename.

Given that till now delete_ref() always dereferenced symrefs, a new
parameters has been introduced to delete_ref() to allow deleting refs
without a dereference.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-26 14:42:57 -07:00
Deskin Miller 225f1d0c6a git-svn: change dashed git-config to git config
Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-24 16:20:30 -07:00
Junio C Hamano 031e6c898f GIT 1.6.0.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-21 13:37:42 -07:00
Nicolas Pitre a672ea6ac5 rehabilitate 'git index-pack' inside the object store
Before commit d0b92a3f6e it was possible to run 'git index-pack'
directly in the .git/objects/pack/ directory.  Restore that ability.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-21 13:20:03 -07:00
Junio C Hamano 5610e3b031 Fix testcase failure when extended attributes are in use
06cbe855 (Make core.sharedRepository more generic, 2008-04-16) made
several testcases in t1301-shared-repo.sh which fail if on a system
which creates files with extended attributes (e.g. SELinux), since ls
appends a '+' sign to the permission set in such cases.  In fact,
POSIX.1 allows ls to add a single printable character after the usual
3x3 permission bits to show that an optional alternate/additional access
method is associated with the path.

This fixes the testcase to strip any such sign prior to verifying the
permission set.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tested-by: Deskin Miller <deskinm@umich.edu>
2008-10-19 22:51:17 -07:00
Junio C Hamano acd3b9eca8 Enhance hold_lock_file_for_{update,append}() API
This changes the "die_on_error" boolean parameter to a mere "flags", and
changes the existing callers of hold_lock_file_for_update/append()
functions to pass LOCK_DIE_ON_ERROR.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-19 12:35:37 -07:00
Junio C Hamano f5637549a7 demonstrate breakage of detached checkout with symbolic link HEAD
When core.prefersymlinkrefs is in use, detaching the HEAD by
checkout incorrectly clobbers the tip of the current branch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-19 12:35:04 -07:00
Abhijit Bhopatkar 09cff066f6 Documentation: Clarify '--signoff' for git-commit
'--signoff' uses commiter name always to add the signoff line,
make it explicit in the documentation.

Signed-off-by: Abhijit Bhopatkar <bain@devslashzero.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-18 22:19:52 -07:00