Commit graph

9566 commits

Author SHA1 Message Date
Martin Koegler 01618a3ab1 use mode of the tree in git-diff, if <tree>:<file> syntax is used
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-24 00:08:49 -07:00
Martin Koegler bb6c2fba41 store mode in rev_list, if <tree>:<filename> syntax is used
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-24 00:08:49 -07:00
Martin Koegler e5709a4a68 add add_object_array_with_mode
Each object in struct object_array is extended with the mode.
If not specified, S_IFINVALID is used. An object with an mode value
can be added with add_object_array_with_mode.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-24 00:08:49 -07:00
Martin Koegler a0cd87a570 add get_sha1_with_mode
get_sha1_with_mode basically behaves as get_sha1. It has an additional
parameter for storing the mode of the object.

If the mode can not be determined, it stores S_IFINVALID.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-24 00:08:49 -07:00
Martin Koegler 40689ae1ef Add S_IFINVALID mode
S_IFINVALID is used to signal, that no mode information is available.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-24 00:08:49 -07:00
Junio C Hamano 520d7e278c Merge branch 'maint'
* maint:
  Documentation/git-reset.txt: suggest git commit --amend in example.
  Build RPM with ETC_GITCONFIG=/etc/gitconfig
  Ignore all man sections as they are generated files.
  Fix typo in git-am: s/Was is/Was it/
  Reverse the order of -b and --track in the man page.
  dir.c(common_prefix): Fix two bugs

Conflicts:

	git.spec.in
2007-04-24 00:08:16 -07:00
OGAWA Hirofumi afb5f39e24 git-fetch: Fix "argument list too long"
If $ls_remote_result was too long,

    git-fetch--tool -s pick-rref "$rref" "$ls_remote_result"

in git-fetch will fail with "argument list too long".

This patch fixes git-fetch--tool and git-fetch by passing
$ls_remote_result via stdin.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-24 00:08:01 -07:00
Gerrit Pape 41728d6942 Documentation/git-reset.txt: suggest git commit --amend in example.
In example 'Undo a commit and redo', refer to 'git commit --amend', as
this is the easier alternative.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 23:55:08 -07:00
Junio C Hamano bbc6354171 Build RPM with ETC_GITCONFIG=/etc/gitconfig
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 23:17:41 -07:00
Brian Gernhardt ce748f5992 Ignore all man sections as they are generated files.
Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 22:19:36 -07:00
Josh Triplett 6777c3806d Fix typo in git-am: s/Was is/Was it/
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 22:14:24 -07:00
Josh Triplett 2122591b3b Add clean.requireForce option, and add -f option to git-clean to override it
Add a new configuration option clean.requireForce.  If set, git-clean will
refuse to run, unless forced with the new -f option, or not acting due to -n.

Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 22:13:50 -07:00
Junio C Hamano ab69e89c7e t6030: grab commit object name as we go
Instead of running rev-list and picking earlier lines using head/tail pipeline,
grab commit object name as we build commits.  This also removes a non POSIX
use of tail with -linenum (more posixly-correct way to say it is "-n linenum")

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 22:11:20 -07:00
Junio C Hamano bd4b0aeb1f t5302: avoid using tail -c
A Large Angry SCM (gitzilla) noticed that on an unnamed platform, tail -c
wants its byte count as part of the option, not as a separate argument.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 22:05:22 -07:00
Johannes Schindelin 557b1e0da5 t4201: Do not display weird characters on the terminal
Now that git-commit got chatty, we have to shut it up again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 21:45:22 -07:00
Nicolas Pitre 4c474b6f92 add file checkout progress
It is nice to see what is happening when checking out large amount of
files, either with git-checkout or git-reset.  The new progress code
already decides what is a "significant amount" and displays progress
only in that case..

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 21:39:28 -07:00
Brian Gernhardt 81178fe48c Reverse the order of -b and --track in the man page.
Using "-b --track newbranch oldbranch" gives the error:

  git checkout: updating paths is incompatible with switching
  branches/forcing

However, "--track -b ..." works just fine.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 16:58:10 -07:00
Johannes Schindelin c7f34c180b dir.c(common_prefix): Fix two bugs
The function common_prefix() is used to find the common subdirectory of
a couple of pathnames. When checking if the next pathname matches up with
the prefix, it incorrectly checked the whole path, not just the prefix
(including the slash). Thus, the expensive part of the loop was executed
always.

The other bug is more serious: if the first and the last pathname in the
list have a longer common prefix than the common prefix for _all_ pathnames
in the list, the longer one would be chosen. This bug was probably hidden
by the fact that bash's wildcard expansion sorts the results, and the code
just so happens to work with sorted input.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 01:44:00 -07:00
Junio C Hamano 2cc3167c68 Document "diff=driver" attribute
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 00:21:02 -07:00
Martin Koegler 4280cde95f gitweb: Show "no difference" message for empty diff
Currently, gitweb shows only header and footer, if no differences are
found. This patch adds a "No differences found" message for the html
output.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 22:49:25 -07:00
Nicolas Pitre 55a9137d8a delay progress display when checking out files
Let's start displaying progress only if more than 50% of total number
of files remains to be checked out after 2 seconds.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 22:18:05 -07:00
Nicolas Pitre 180a9f2268 provide a facility for "delayed" progress reporting
This allows for progress to be displayed only if the progress has not
reached a specified percentage treshold within a given delay in seconds.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 22:18:05 -07:00
Nicolas Pitre 13aaf14825 make progress "title" part of the common progress interface
If the progress bar ends up in a box, better provide a title for it too.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 22:18:05 -07:00
Nicolas Pitre 96a02f8f6d common progress display support
Instead of having this code duplicated in multiple places, let's have
a common interface for progress display.  If someday someone wishes to
display a cheezy progress bar instead then only one file will have to
be changed.

Note: I left merge-recursive.c out since it has a strange notion of
progress as it apparently increase the expected total number as it goes.
Someone with more intimate knowledge of what that is supposed to mean
might look at converting it to the common progress interface.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 22:18:05 -07:00
Junio C Hamano f1af60bdba Support 'diff=pgm' attribute
This enhances the attributes mechanism so that external programs
meant for existing GIT_EXTERNAL_DIFF interface can be specifed
per path.

To configure such a custom diff driver, first define a custom
diff driver in the configuration:

	[diff "my-c-diff"]
		command = <<your command string comes here>>

Then mark the paths that you want to use this custom driver
using the attribute mechanism.

	*.c	diff=my-c-diff

The intent of this separation is that the attribute mechanism is
used for specifying the type of the contents, while the
configuration mechanism is used to define what needs to be done
to that type of the contents, which would be specific to both
platform and personal taste.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 22:16:14 -07:00
Junio C Hamano d83c9af5c6 pack-objects: make generated packfile read-only
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 19:00:16 -07:00
Junio C Hamano a5878961b1 Update tests not to assume that generated packfiles are writable.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 18:59:34 -07:00
Junio C Hamano b6b32ccb92 Fix 'quickfix' on pack-objects.
The earlier quickfix forced world-readable permission bits.  This
updates it to honor umask and core.sharedrepository settings.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 12:28:34 -07:00
Junio C Hamano aef5aedd85 pack-objects: quickfix for permission modes.
mkstemp() often creates the file in 0600 which means the
resulting packfile is not readable by anybody other than the
repository owner.  Force 0644 for now, even though this is not
strictly correct.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 11:49:35 -07:00
Alex Riesen 4629795816 Fix crash in t0020 (crlf conversion)
Reallocated wrong size.
Noticed on Ubuntu 7.04 probably because it has some malloc diagnostics in libc:
"git-read-tree --reset -u HEAD" aborted in the test. Valgrind sped up the
debugging greatly: took me 10 minutes.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 10:44:56 -07:00
Alex Riesen 67e22ed58f Fix a typo in crlf conversion code
Also, noticed by valgrind: the code caused a read out-of-bounds.
Some comments updated as well (they still reflected old calling
conventions).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 10:44:38 -07:00
Shawn O. Pearce 2b6854c863 Cleanup variables in cat-file
I want to add new command line options to cat-file, but
to do that we need to change how we handle argv[] first.
This is a simple cleanup that assigns names to the two
arguments we currently care about.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 00:43:24 -07:00
Junio C Hamano 7392b03aa4 Update draft release notes for v1.5.2
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 00:26:56 -07:00
Junio C Hamano 2d76548b6a Documentation/Makefile: fix section (5) installation
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-22 00:21:17 -07:00
Junio C Hamano fdd3e7d959 Update documentation links to point at v1.5.1.2
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-21 23:51:27 -07:00
Junio C Hamano 42c4b58059 Merge branch 'lt/objalloc'
* 'lt/objalloc':
  Clean up object creation to use more common code
  Use proper object allocators for unknown object nodes too
2007-04-21 17:42:02 -07:00
Junio C Hamano 520635fa3a Merge branch 'jc/add'
* jc/add:
  git-add -u: match the index with working tree.
2007-04-21 17:40:48 -07:00
Junio C Hamano a2d7c6c620 Merge branch 'jc/attr'
* 'jc/attr': (28 commits)
  lockfile: record the primary process.
  convert.c: restructure the attribute checking part.
  Fix bogus linked-list management for user defined merge drivers.
  Simplify calling of CR/LF conversion routines
  Document gitattributes(5)
  Update 'crlf' attribute semantics.
  Documentation: support manual section (5) - file formats.
  Simplify code to find recursive merge driver.
  Counto-fix in merge-recursive
  Fix funny types used in attribute value representation
  Allow low-level driver to specify different behaviour during internal merge.
  Custom low-level merge driver: change the configuration scheme.
  Allow the default low-level merge driver to be configured.
  Custom low-level merge driver support.
  Add a demonstration/test of customized merge.
  Allow specifying specialized merge-backend per path.
  merge-recursive: separate out xdl_merge() interface.
  Allow more than true/false to attributes.
  Document git-check-attr
  Change attribute negation marker from '!' to '-'.
  ...
2007-04-21 17:38:00 -07:00
Junio C Hamano afb5b6a24b Merge branch 'lt/gitlink'
* lt/gitlink:
  Tests for core subproject support
  Expose subprojects as special files to "git diff" machinery
  Fix some "git ls-files -o" fallout from gitlinks
  Teach "git-read-tree -u" to check out submodules as a directory
  Teach git list-objects logic to not follow gitlinks
  Fix gitlink index entry filesystem matching
  Teach "git-read-tree -u" to check out submodules as a directory
  Teach git list-objects logic not to follow gitlinks
  Don't show gitlink directories when we want "other" files
  Teach git-update-index about gitlinks
  Teach directory traversal about subprojects
  Fix thinko in subproject entry sorting
  Teach core object handling functions about gitlinks
  Teach "fsck" not to follow subproject links
  Add "S_IFDIRLNK" file mode infrastructure for git links
  Add 'resolve_gitlink_ref()' helper function
  Avoid overflowing name buffer in deep directory structures
  diff-lib: use ce_mode_from_stat() rather than messing with modes manually
2007-04-21 17:21:10 -07:00
Junio C Hamano 99ebd06c18 Merge branch 'np/pack'
* np/pack: (27 commits)
  document --index-version for index-pack and pack-objects
  pack-objects: remove obsolete comments
  pack-objects: better check_object() performances
  add get_size_from_delta()
  pack-objects: make in_pack_header_size a variable of its own
  pack-objects: get rid of create_final_object_list()
  pack-objects: get rid of reuse_cached_pack
  pack-objects: clean up list sorting
  pack-objects: rework check_delta_limit usage
  pack-objects: equal objects in size should delta against newer objects
  pack-objects: optimize preferred base handling a bit
  clean up add_object_entry()
  tests for various pack index features
  use test-genrandom in tests instead of /dev/urandom
  simple random data generator for tests
  validate reused pack data with CRC when possible
  allow forcing index v2 and 64-bit offset treshold
  pack-redundant.c: learn about index v2
  show-index.c: learn about index v2
  sha1_file.c: learn about index version 2
  ...
2007-04-21 17:20:50 -07:00
Junio C Hamano e32442a676 Merge branch 'jp/refs'
* jp/refs:
  refs.c: add a function to sort a ref list, rather then sorting on add
2007-04-21 17:19:34 -07:00
Junio C Hamano e660e11b20 Merge branch 'jc/quickfetch'
* jc/quickfetch:
  Make sure quickfetch is not fooled with a previous, incomplete fetch.
  git-fetch: use fetch--tool pick-rref to avoid local fetch from alternate
  git-fetch--tool pick-rref
2007-04-21 17:19:25 -07:00
Junio C Hamano e8760cde01 Merge branch 'maint'
* maint:
  GIT 1.5.1.2
  perl: install private Error.pm if the site version is older than our own
  git-clone: fix dumb protocol transport to clone from pack-pruned ref
2007-04-21 17:16:48 -07:00
Junio C Hamano 97317061c6 GIT 1.5.1.2
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-21 13:57:07 -07:00
Eric Wong 4a40cbd949 perl: install private Error.pm if the site version is older than our own
bdash (on IRC) had a problem with Git.pm (via git-svn) when his
site installation of Error.pm was older than the version we
package.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-21 13:06:24 -07:00
Junio C Hamano 5e635e3960 lockfile: record the primary process.
The usual process flow is the main process opens and holds the lock to
the index, does its thing, perhaps spawning children during the course,
and then writes the resulting index out by releaseing the lock.

However, the lockfile interface uses atexit(3) to clean it up, without
regard to who actually created the lock.  This typically leads to a
confusing behaviour of lock being released too early when the child
exits, and then the parent process when it calls commit_lockfile()
finds that it cannot unlock it.

This fixes the problem by recording who created and holds the lock, and
upon atexit(3) handler, child simply ignores the lockfile the parent
created.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-21 11:55:23 -07:00
Junio C Hamano 6073ee8571 convert.c: restructure the attribute checking part.
This separates the checkattr() call and interpretation of the
returned value specific to the 'crlf' attribute into separate
routines, so that we can run a single call to checkattr() to
check for more than one attributes, and then interprete what
the returned settings mean separately.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-21 11:55:23 -07:00
Junio C Hamano e87b1c943a Fix bogus linked-list management for user defined merge drivers.
ll_user_merge_tail is supposed to point at the pointer to be
updated to point at a newly created item.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-21 00:05:31 -07:00
Alex Riesen ac78e54804 Simplify calling of CR/LF conversion routines
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-20 23:24:34 -07:00
Linus Torvalds 2a1a3dce33 Fix a copy-n-paste bug in the object decorator code.
Duh.

When I did the object decorator thing, I made the "loop over the hash"
function use the same logic for updating the hash, ie made them use

	if (++j >= size)
		j = 0;

for both the hash update for both "insert" and "lookup"

HOWEVER.

For some inexplicable reason I had an extraneous

	j++;

in the insert path (probably just from the fact that the old code there
used

	j++;
	if (j >= size)
		j = 0;

and when I made them use the same logic I just didn't remove the old
extraneous line properly.

This fixes it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-20 19:16:12 -07:00