Commit graph

10078 commits

Author SHA1 Message Date
Frank Lichtenheld 1d431b2235 t9400: Add test cases for config file handling
Add a few test cases for the config file parsing
done by git-cvsserver.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-22 00:00:42 -07:00
Junio C Hamano a74db82e15 Teach "delta" attribute to pack-objects.
This teaches pack-objects to use .gitattributes mechanism so
that the user can specify certain blobs are not worth spending
CPU cycles to attempt deltification.

The name of the attrbute is "delta", and when it is set to
false, like this:

	== .gitattributes ==
	*.jpg	-delta

they are always stored in the plain-compressed base object
representation.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-21 23:58:20 -07:00
Junio C Hamano bc32fed551 pack-objects: pass fullname down to add_object_entry()
Instead of giving a hash for grouping, pass fullname to add_object_entry().
I want to add "do not try deltifying this object" bit to object_entry based on
the settings in .gitattributes, and hashing the name down too early would
interfere with that plan.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-21 23:58:20 -07:00
Junio C Hamano a3342a2f52 Merge branch 'mc/ws'
* mc/ws:
  git-apply: Fix removal of new trailing blank lines.
  Teach 'git-apply --whitespace=strip' to remove empty lines at the end of file
2007-05-21 23:57:05 -07:00
Shawn O. Pearce 23615708e2 Teach git-describe how to run name-rev
Often users want to know not which tagged version a commit came
after, but which tagged version a commit is contained within.
This latter task is the job of git-name-rev, but most users are
looking to git-describe to do the job.

Junio suggested we make `git describe --contains` run the correct
tool, `git name-rev`, and that's exactly what we do here.  The output
of name-rev was adjusted slightly through the new --name-only option,
allowing describe to execv into name-rev and maintain its current
output format.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-21 23:56:28 -07:00
Martin Waitz 302b9282c9 rename dirlink to gitlink.
Unify naming of plumbing dirlink/gitlink concept:

git ls-files -z '*.[ch]' |
xargs -0 perl -pi -e 's/dirlink/gitlink/g;' -e 's/DIRLNK/GITLINK/g;'

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-21 23:34:54 -07:00
Junio C Hamano fbf5df024e Merge branch 'maint'
* maint:
  git-cvsserver: fix disabling service via per-method config
  git-status: respect core.excludesFile
  SubmittingPatches: mention older C compiler compatibility
  git-daemon: don't ignore pid-file write failure
2007-05-21 20:03:53 -07:00
Junio C Hamano 523d12e500 git-cvsserver: fix disabling service via per-method config
When the per-method enable logic disables the access, we should
not even look at the global one.

 git-cvsserver.perl |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-21 18:42:57 -07:00
Junio C Hamano f95c6780c2 Merge branch 'maint-1.5.1' into maint
* maint-1.5.1:
  git-status: respect core.excludesFile
  SubmittingPatches: mention older C compiler compatibility
  git-daemon: don't ignore pid-file write failure
2007-05-21 18:42:35 -07:00
Johannes Schindelin 0ba956d331 git-status: respect core.excludesFile
git-add reads this variable, and honours the contents of that file if that
exists. Match this behaviour in git-status, too.

Noticed by Evan Carroll on IRC.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-21 18:36:02 -07:00
Johannes Schindelin 243bfd3399 SubmittingPatches: mention older C compiler compatibility
We do not appreciate C99 initializers, declarations after statements,
or "0" instead of "NULL".

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-21 18:35:37 -07:00
Jim Meyering bc4e7d0358 git-daemon: don't ignore pid-file write failure
Note: since the consequence of failure is to call die,
I don't bother to close "f".

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-21 18:34:14 -07:00
Junio C Hamano 077e1af598 git-apply: Fix removal of new trailing blank lines.
The earlier code removed one newline too many from the hunk that
adds new lines at the end of the file.  Also the way the code
counted the added blank lines was somewhat roundabout; I think
the way updated code does it is more direct and easier to
follow:

 * We keep track of the number of blank lines added;

 * While processing each line, we notice if it adds a blank
   line, and increment the counter, or reset it to zero
   otherwise;

 * When actually we apply the data, we remove the empty lines we
   counted earlier if we are applying it at the end of the
   file.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 23:51:06 -07:00
Jonas Fonseca 56d99c67d1 Update bash completion to ignore some more plumbing commands
[sp: Modified Jonas' original patch to keep checkout-index
 as a a valid completion.]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-21 02:09:26 -04:00
Dana L. How 6b94b1a09a git-repack --max-pack-size: add option parsing to enable feature
Add --max-pack-size parsing and usage messages.
Upgrade git-repack.sh to handle multiple packfile names,
and build packfiles in GIT_OBJECT_DIRECTORY not GIT_DIR.
Update documentation.

Signed-off-by: Dana L. How <danahow@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 21:55:26 -07:00
Dana L. How ebe27b137c git-repack --max-pack-size: split packs as asked by write_{object,one}()
Rewrite write_pack_file() to break to a new packfile
whenever write_object/write_one request it,  and
correct the header's object count in the previous packfile.
Change write_index_file() to write an index
for just the objects in the most recent packfile.

Signed-off-by: Dana L. How <danahow@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 21:55:26 -07:00
Dana L. How 17b08f2cd0 git-repack --max-pack-size: write_{object,one}() respect pack limit
With --max-pack-size,  generate the appropriate write limit
for each object and check against it before each group of writes.
Update delta usability rules to handle base being in a previously-
written pack.  Inline sha1write_compress() so we know the
exact size of the written data when it needs to be compressed.
Detect and return write "failure".

Signed-off-by: Dana L. How <danahow@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 21:55:26 -07:00
Dana L. How d01fb92f8d git-repack --max-pack-size: new file statics and code restructuring
Add "pack_size_limit", the limit specified by --max-pack-size,
"written_list", the list of objects written to the current pack,
and "nr_written", the number of objects in written_list.
Put "base_name" at file scope again and add forward declarations.
Move write_index_file() call from cnd_pack_objects() to
write_pack_file() since only the latter will know how
many times to call write_index_file().

Signed-off-by: Dana L. How <danahow@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 21:55:26 -07:00
Dana L. How f02153696f Alter sha1close() 3rd argument to request flush only
update=0 suppressed writing the final SHA-1 but was not used.
Now final=0 suppresses SHA-1 finalization, SHA-1 writing,
and closing -- in other words,  only flush the buffer.

Signed-off-by: Dana L. How <danahow@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 21:55:26 -07:00
Jakub Narebski a5bbda8b7b Add an option to git-ls-tree to display also the size of blob
Add -l/--long option to git-ls-tree command, which displays
object size of a blob entry.  Object size is placed after
object id (left-justified with minimum width of 7 characters).
For non-blob entries `-' is used.

Rationale: for non-blob entries size of an object has no much
meaning, and is not very interesting.  Moreover, in planned
pack v4 tree objects would be constructed on demand, so tree
size would need to be calculated.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 21:43:46 -07:00
Daniel Barkalow b516968ff6 Update local tracking refs when pushing
This also adds a --remote option to send-pack, which specifies the
configured remote being used. It is provided automatically by
git-push, and must match the url (which is still needed, since there
could be multiple urls).

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 21:32:57 -07:00
Daniel Barkalow 5d46c9d41f Add handlers for fetch-side configuration of remotes.
These follow the pattern of the push side configuration, but aren't
taken from anywhere else, because git-fetch is still in shell.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 21:32:56 -07:00
Daniel Barkalow 6b62816cb1 Move refspec parser from connect.c and cache.h to remote.{c,h}
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 21:32:56 -07:00
Daniel Barkalow 5751f49010 Move remote parsing into a library file out of builtin-push.
The new parser is different from the one in builtin-push in two ways:
the default is to use the current branch's remote, if there is one,
before "origin"; and config is used in preference to remotes.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 21:32:56 -07:00
Marco Costalba efe7f35861 Teach 'git-apply --whitespace=strip' to remove empty lines at the end of file
[jc: with an obvious microfix to avoid doing this unless --whitespace=strip]

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 20:36:24 -07:00
Petr Baudis 93d496a560 git-rev-list: Add regexp tuning options
This patch introduces --extended-regexp and --regexp-ignore-case options to
tune what kind of patterns the pattern-limiting options (--grep, --author,
...) accept.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 20:31:50 -07:00
Jakub Narebski 77e4e8bd9b gitweb: Add test t9500 for gitweb (as standalone script)
This test runs gitweb (git web interface) as CGI script from
commandline, and checks that it would not write any errors
or warnings to log.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 19:59:04 -07:00
Junio C Hamano 738a1154db Merge branch 'maint'
* maint:
  annotate: make it work from subdirectories.
  git-config: Correct asciidoc documentation for --int/--bool
  t1300: Add tests for git-config --bool --get
  unpack-trees.c: verify_uptodate: remove dead code
  Use PATH_MAX instead of TEMPFILE_PATH_LEN
  branch: fix segfault when resolving an invalid HEAD
2007-05-20 19:58:03 -07:00
Junio C Hamano 7df6ddf51e Merge branch 'maint-1.5.1' into maint
* maint-1.5.1:
  annotate: make it work from subdirectories.
  git-config: Correct asciidoc documentation for --int/--bool
  t1300: Add tests for git-config --bool --get
  unpack-trees.c: verify_uptodate: remove dead code
  Use PATH_MAX instead of TEMPFILE_PATH_LEN
  branch: fix segfault when resolving an invalid HEAD
2007-05-20 19:57:00 -07:00
Junio C Hamano 5b6dedd6a0 annotate: make it work from subdirectories.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 19:56:28 -07:00
Frank Lichtenheld 0cb21911f4 git-config: Correct asciidoc documentation for --int/--bool
The asciidoc documentation seemed to indicate that type specifiers
are honoured on writing operations which they aren't. Make this
more clear.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 16:00:23 -07:00
Frank Lichtenheld cab333cb6a t1300: Add tests for git-config --bool --get
Noticed that there were only tests for --int, but not
for --bool. Add some.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 16:00:22 -07:00
Sven Verdoolaege 0a76f66524 unpack-trees.c: verify_uptodate: remove dead code
This code was killed by commit fcc387db9b.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 14:40:41 -07:00
Fernando J. Pereda 1472966c04 Use PATH_MAX instead of TEMPFILE_PATH_LEN
Signed-off-by: Fernando J. Pereda <ferdy@gentoo.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 14:40:34 -07:00
Jonas Fonseca 078f8380f6 branch: fix segfault when resolving an invalid HEAD
Caused by return value of resolve_ref being passed directly
to xstrdup whereby the sanity checking was never reached.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 14:39:16 -07:00
Junio C Hamano 45bde46bfb Merge branch 'dh/pack'
* dh/pack:
  Custom compression levels for objects and packs
2007-05-20 02:19:19 -07:00
Junio C Hamano e223249a13 Merge branch 'mst/connect'
* mst/connect:
  connect: display connection progress
2007-05-20 02:18:50 -07:00
Junio C Hamano 063581e9b6 Merge branch 'sv/checkout'
* sv/checkout:
  git-update-ref: add --no-deref option for overwriting/detaching ref
2007-05-20 02:18:47 -07:00
Junio C Hamano cc93020f52 Merge branch 'np/pack'
* np/pack:
  deprecate the new loose object header format
  make "repack -f" imply "pack-objects --no-reuse-object"
  allow for undeltified objects not to be reused
2007-05-20 02:18:43 -07:00
Junio C Hamano a0f5b7f017 Merge branch 'tt/gc'
* tt/gc:
  Add --aggressive option to 'git gc'
2007-05-20 02:18:40 -07:00
Junio C Hamano 5610c6e381 Merge branch 'jb/statcolor'
* jb/statcolor:
  Add colour support in rebase and merge tree diff stats output.
2007-05-20 02:18:37 -07:00
Junio C Hamano aba170cdb4 GIT 1.5.2
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 00:30:39 -07:00
Junio C Hamano e40a30452d git-cvsserver: exit with 1 upon "I HATE YOU"
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 00:19:48 -07:00
Junio C Hamano 03f6db0ec0 Merge branch 'maint' to synchronize with 1.5.1.6
* maint:
  GIT 1.5.1.6
  git-svn: don't minimize-url when doing an init that tracks multiple paths
  git-svn: avoid crashing svnserve when creating new directories
  user-manual: Add section on ignoring files
  user-manual: finding commits referencing given file content
  user-manual: discourage shared repository
  tutorial: revise index introduction
  tutorials: add user-manual links

Conflicts:

	GIT-VERSION-GEN
	RelNotes
2007-05-20 00:19:30 -07:00
Junio C Hamano f7b47b273e GIT 1.5.1.6
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-20 00:15:53 -07:00
Junio C Hamano 2be2e267aa Merge branch 'maint' of git://linux-nfs.org/~bfields/git into maint
* 'maint' of git://linux-nfs.org/~bfields/git:
  user-manual: Add section on ignoring files
  user-manual: finding commits referencing given file content
  user-manual: discourage shared repository
  tutorial: revise index introduction
  tutorials: add user-manual links
2007-05-19 23:25:59 -07:00
Eric Wong dc431666d3 git-svn: don't minimize-url when doing an init that tracks multiple paths
I didn't have a chance to test the off-by-default minimize-url
stuff enough before, but it's quite broken for people passing
the --trunk/-T, --tags/-t, --branches/-b switches to "init" or
"clone" commands.

Additionally, follow-parent functionality seems broken when we're
not connected to the root of the repository.

Default behavior for "traditional" git-svn users who only track
one directory (without needing follow-parent) should be
reasonable, as those users started using things before
minimize-url functionality existed.

Behavior for users more used to the git-svnimport-like command
line will also benefit from a more-flexible command-line than
svnimport given the assumption they're working with
non-restrictive read permissions on the repository.

I hope to properly fix these bugs when I get a chance to in the
next week or so, but I would like to get this stopgap measure of
reverting to the old behavior as soon as possible.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-19 12:28:50 -07:00
Eric Wong 6442754d6c git-svn: avoid crashing svnserve when creating new directories
When sorting directory names by depth (slash ("/") count) and
closing the deepest directories first (as the protocol
requires), we failed to put the root baton (with an empty string
as its key "") after top-level directories (which did not have
any slashes).

This resulted in svnserve being in a situation it couldn't
handle and caused a segmentation fault on the remote server.

This bug did not affect users of DAV and filesystem repositories.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Confirmed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-19 12:26:36 -07:00
Johan Herland 2dc53617a4 user-manual: Add section on ignoring files
The todo list at the end of the user manual says that something must be
said about .gitignore. Also, there seems to be a lack of documentation
on how to choose between the various types of ignore files (.gitignore
vs. .git/info/exclude, etc.).

This patch adds a section on ignoring files which try to introduce how
to tell git about ignored files, and how the different strategies
complement eachother.

The syntax of exclude patterns is explained in a simplified manner, with
a reference to git-ls-files(1) which already contains a more thorough
explanation.

Signed-off-by: Johan Herland <johan@herland.net>
2007-05-19 01:06:05 -04:00
J. Bruce Fields 187b0d80df user-manual: finding commits referencing given file content
Another amusing git exploration example brought up in irc.  (Credit to
aeruder for the complete solution.)

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-05-19 01:00:55 -04:00