1
0
mirror of https://github.com/git/git.git synced 2024-10-05 02:11:43 +02:00
Commit Graph

11613 Commits

Author SHA1 Message Date
Junio C Hamano
f6336167e9 Merge branch 'jc/grep-c'
* jc/grep-c:
  Split grep arguments in a way that does not requires to add /dev/null.
  Documentation/git-config.txt: AsciiDoc tweak to avoid leading dot
  Add test to check recent fix to "git add -u"
  Documentation/git-archive.txt: a couple of clarifications.
  Fix the rename detection limit checking
  diff --no-index: do not forget to run diff_setup_done()
2007-09-14 15:17:07 -07:00
Junio C Hamano
d99ebf0817 Split grep arguments in a way that does not requires to add /dev/null.
In order to (almost) always show the name of the file without
relying on "-H" option of GNU grep, we used to add /dev/null to
the argument list unless we are doing -l or -L.  This caused
"/dev/null:0" to show up when -c is given in the output.

It is not enough to add -c to the set of options we do not pass
/dev/null for.  When we have too many files, we invoke grep
multiple times and we need to avoid giving a widow filename to
the last invocation -- otherwise we will not see the name.

This keeps two filenames when the argv[] buffer is about to
overflow and we have not finished iterating over the index, so
that the last round will always have at least two paths to work
with (and not require /dev/null).

An obvious and the only exception is when there is only 1 file
that is given to the underlying grep, and in that case we avoid
passing /dev/null and let the external "grep -c" report only the
number of matches.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-14 15:16:43 -07:00
Junio C Hamano
7c8b5eaf22 Documentation/git-config.txt: AsciiDoc tweak to avoid leading dot
Bram Schoenmakers noticed that git-config document was formatted
incorrectly.  Depending on the version of AsciiDoc and docbook
toolchain, it is sometimes taken as a numbered example by AsciiDoc,
some other times passed intact to roff format to confuse "man".

Since we refer to the repository metadata directory as $GIT_DIR
elsewhere, work it around by using that symbolic name.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-14 14:51:08 -07:00
Benoit Sigoure
43b98acc23 Add test to check recent fix to "git add -u"
An earlier commit fixed type-change case in "git add -u".
This adds a test to make sure we do not introduce regression.

At the same time, it fixes a stupid typo in the error message.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-14 14:30:05 -07:00
Jari Aalto
42b5f8693e Documentation/git-archive.txt: a couple of clarifications.
The description of the option gave impression that there
were several formats available by using three dots. There are
no other formats than tar and gzip currently supported.

Clarify that the archive goes to the standard output.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-14 12:17:11 -07:00
Linus Torvalds
0024a54923 Fix the rename detection limit checking
This adds more proper rename detection limits. Instead of just checking
the limit against the number of potential rename destinations, we verify
that the rename matrix (which is what really matters) doesn't grow
ridiculously large, and we also make sure that we don't overflow when
doing the matrix size calculation.

This also changes the default limits from unlimited, to a rename matrix
that is limited to 100 entries on a side. You can raise it with the config
entry, or by using the "-l<n>" command line flag, but at least the default
is now a sane number that avoids spending lots of time (and memory) in
situations that likely don't merit it.

The choice of default value is of course very debatable. Limiting the
rename matrix to a 100x100 size will mean that even if you have just one
obvious rename, but you also create (or delete) 10,000 files, the rename
matrix will be so big that we disable the heuristics. Sounds reasonable to
me, but let's see if people hit this (and, perhaps more importantly,
actually *care*) in real life.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-14 12:12:57 -07:00
Junio C Hamano
b78281f721 diff --no-index: do not forget to run diff_setup_done()
Code inspection by Linus found this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-14 12:12:32 -07:00
Junio C Hamano
58f6fb53dd Merge branch 'jc/cachetree' into cr/reset
* jc/cachetree:
  Simplify cache API
  git-format-patch --in-reply-to: accept <message@id> with angle brackets
  git-add -u: do not barf on type changes
  Remove duplicate note about removing commits with git-filter-branch
  git-clone: improve error message if curl program is missing or not executable
  git.el: Allow the add and remove commands to be applied to ignored files.
  git.el: Allow selecting whether to display uptodate/unknown/ignored files.
  git.el: Keep the status buffer sorted by filename.
  hooks--update: Explicitly check for all zeros for a deleted ref.
2007-09-14 01:19:30 -07:00
Junio C Hamano
09d5dc32fb Simplify cache API
Earlier, add_file_to_index() invalidated the path in the cache-tree
but remove_file_from_cache() did not, and the user of the latter
needed to invalidate the entry himself.  This led to a few bugs due to
missed invalidate calls already.  This patch makes the management of
cache-tree less error prone by making more invalidate calls from lower
level cache API functions.

The rules are:

 - If you are going to write the index, you should either maintain
   cache_tree correctly.

   - If you cannot, alternatively you can remove the entire cache_tree
     by calling cache_tree_free() before you call write_cache().

   - When you modify the index, cache_tree_invalidate_path() should be
     called with the path you are modifying, to discard the entry from
     the cache-tree structure.

 - The following cache API functions exported from read-cache.c (and
   the macro whose names have "cache" instead of "index")
   automatically call cache_tree_invalidate_path() for you:

   - remove_file_from_index();
   - add_file_to_index();
   - add_index_entry();

   You can modify the index bypassing the above API functions
   (e.g. find an existing cache entry from the index and modify it in
   place).  You need to call cache_tree_invalidate_path() yourself in
   such a case.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-14 01:02:21 -07:00
Junio C Hamano
611d8139e4 Merge branch 'maint'
* maint:
  git-format-patch --in-reply-to: accept <message@id> with angle brackets
  git-add -u: do not barf on type changes
  Remove duplicate note about removing commits with git-filter-branch
  git-clone: improve error message if curl program is missing or not executable
  hooks--update: Explicitly check for all zeros for a deleted ref.
2007-09-14 00:55:32 -07:00
Junio C Hamano
8419d2ee9b git-format-patch --in-reply-to: accept <message@id> with angle brackets
This will allow RFC-literate users to say:

	format-patch --in-reply-to='<message.id@site.name>'

without forcing them to strip the surrounding angle brackets
like this:

	format-patch --in-reply-to='message.id@site.name'

We accept both forms, and the latter gets necessary < and >
around it as before.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-14 00:49:12 -07:00
Junio C Hamano
767c98a592 git-add -u: do not barf on type changes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-14 00:45:29 -07:00
Ulrik Sverdrup
f5de79956b Remove duplicate note about removing commits with git-filter-branch
A duplicate of an already existing section in the documentation of
git-filter-branch was added in commit
f95eef15f2f8a336b9a42749f5458c841a5a5d63.
This patch removes that redundant section.

Signed-off-by: Ulrik Sverdrup <ulrik.sverdrup@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13 22:53:53 -07:00
Gerrit Pape
f28dd4774d git-clone: improve error message if curl program is missing or not executable
If the curl program is not available (or not executable), and git clone is
started to clone a repository through http, this is the output

 Initialized empty Git repository in /tmp/puppet/.git/
 /usr/bin/git-clone: line 37: curl: command not found
 Cannot get remote repository information.
 Perhaps git-update-server-info needs to be run there?

This patch improves the error message by checking the return code when
running curl to exit immediately if it's 126 or 127; the error output now
is

 Initialized empty Git repository in /tmp/puppet/.git/
 /usr/bin/git-clone: line 37: curl: command not found

Adrian Bridgett noticed this and reported through
 http://bugs.debian.org/440976

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13 22:39:22 -07:00
Alexandre Julliard
568d2cde9b git.el: Allow the add and remove commands to be applied to ignored files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13 22:37:54 -07:00
Alexandre Julliard
98acc3fabc git.el: Allow selecting whether to display uptodate/unknown/ignored files.
The default behavior for each state can be customized, and it can also
be toggled directly from the status buffer.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13 22:37:54 -07:00
Alexandre Julliard
1b655040be git.el: Keep the status buffer sorted by filename.
This makes insertions and updates much more efficient.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13 22:36:22 -07:00
Alexandre Julliard
c32da692de hooks--update: Explicitly check for all zeros for a deleted ref.
The previous check caused the hook to reject as unannotated any tag
whose SHA1 starts with a zero.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13 22:33:11 -07:00
Junio C Hamano
cbb390cd8f An additional test for "git-reset -- path"
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13 20:54:14 -07:00
Shawn O. Pearce
55bad4f096 git-gui: Paper bag fix "Commit->Revert" format arguments
The recent bug fix to correctly handle filenames with %s (or any
other valid Tcl format specifier) missed a \ on this line and
caused the remaining format arguments to not be supplied when we
updated the status bar.  This caused a Tcl error anytime the user
was trying to perform a file revert.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-13 20:08:53 -04:00
Shawn O. Pearce
042f53c569 git-gui: Provide 'uninstall' Makefile target to undo an installation
Several users have requested a "make uninstall" target be provided
in the stock git-gui Makefile so that they can undo an install
if git-gui goes to the wrong place during the initial install,
or if they are unhappy with the tool and want to remove it from
their system.

We currently assume that the complete set of files we need to delete
are those defined by our Makefile and current source directory.
This could differ from what the user actually has installed if they
installed one version then attempt to use another to perform the
uninstall.  Right now I'm just going to say that is "pilot error".
Users should uninstall git-gui using the same version of source
that they used to make the installation.  Perhaps in the future we
could read tclIndex and base our uninstall decisions on its contents.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-13 20:02:39 -04:00
Shawn O. Pearce
afe2098ddd git-gui: Font chooser to handle a large number of font families
Simon Sasburg noticed that on X11 if there are more fonts than can
fit in the height of the screen Tk's native tk_optionMenu does not
offer scroll arrows to the user and it is not possible to review
all choices or to select those that are off-screen.  On Mac OS X
the tk_optionMenu works properly but is awkward to navigate if the
list is long.

This is a rewrite of our font selection by providing a new modal
dialog that the user can launch from the git-gui Options panel.
The dialog offers the user a scrolling list of fonts in a pane.
An example text shows the user what the font looks like at the size
they have selected.  But I have to admit the example pane is less
than ideal.  For example in the case of our diff font we really
should show the user an example diff complete with our native diff
syntax coloring.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Acked-by: Simon Sasburg <simon.sasburg@gmail.com>
2007-09-13 19:07:46 -04:00
Shawn O. Pearce
e7034d66ec git-gui: Make backporting changes from i18n version easier
This is a very trivial hack to define a global mc procedure that
does not actually perform i18n translations on its input strings.
By declaring an mc procedure here in our maint version of git-gui
we can take patches that are intended for the latest development
version of git-gui and easily backport them without needing to
tweak the mc calls first.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-13 19:04:14 -04:00
Junio C Hamano
80bffaf7fb git-commit: Allow partial commit of file removal.
When making a partial commit, git-commit uses git-ls-files with
the --error-unmatch option to expand and sanity check the user
supplied path patterns.  When any path pattern does not match
with the paths known to the index, it errors out, in order to
catch a common mistake to say "git commit Makefiel cache.h"
and end up with a commit that touches only cache.h (notice the
misspelled "Makefile").  This detection however does not work
well when the path has already been removed from the index.

If you drop a path from the index and try to commit that
partially, i.e.

	$ git rm COPYING
	$ git commit -m 'Remove COPYING' COPYING

the command complains because git does not know anything about
COPYING anymore.

This introduces a new option --with-tree to git-ls-files and
uses it in git-commit when we build a temporary index to
write a tree object for the partial commit.

When --with-tree=<tree-ish> option is specified, names from the
given tree are added to the set of names the index knows about,
so we can treat COPYING file in the example as known.

Of course, there is no reason to use "git rm" and git-aware
people have long time done:

	$ rm COPYING
	$ git commit -m 'Remove COPYING' COPYING

which works just fine.  But this caused a constant confusion.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-12 16:40:59 -07:00
Carlos Rica
0e5a7faa3a Make "git reset" a builtin.
This replaces the script "git-reset.sh" with "builtin-reset.c".

A few git commands used in the script are called from the builtin also:
"ls-files" to check for unmerged files, "read-tree" for resetting
the index file in "mixed" and "hard" resets, and "update-index" to
refresh at the end in the "mixed" reset and also for the option that
gets selected paths into the index.

The reset option with paths was implemented by Johannes Schindelin.

Since the option that gets selected paths into the index is not
a "reset" like the others because it does not change the HEAD at all,
now the command is showing a warning when the "--mixed" option
is supplied for that purpose.

The following table shows the behaviour of "git reset" for
the different supported options, where X means "changing"
the HEAD, index or working tree:

reset:  --soft  --mixed  --hard  -- <paths>
HEAD       X       X        X        -
index      -       X        X        X
files      -       -        X        -

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-12 13:25:07 -07:00
Carlos Rica
6640f88165 Move make_cache_entry() from merge-recursive.c into read-cache.c
The function make_cache_entry() is too useful to be hidden away in
merge-recursive.  So move it to libgit.a (exposing it via cache.h).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-12 13:25:07 -07:00
Carlos Rica
359048d6ec Add tests for documented features of "git reset".
This adds the new file t/t7102-reset.sh following the text
and examples in "Documentation/git-reset.txt" in order to
check the behaviour of the upcoming "builtin-reset.c",
and be able to compare it with the original "git-reset.sh".

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-12 13:25:07 -07:00
Junio C Hamano
88b7dd4597 Merge branch 'maint'
* maint:
  stash: end index commit log with a newline
  git-commit: Disallow amend if it is going to produce an empty non-merge commit
  git-send-email.perl: Add angle brackets to In-Reply-To if necessary
  Fix a test failure (t9500-*.sh) on cygwin
2007-09-12 13:07:20 -07:00
Junio C Hamano
3d80017d0c Merge branch 'sp/maint-no-thin' into maint
* sp/maint-no-thin:
  Make --no-thin the default in git-push to save server resources
2007-09-12 13:07:06 -07:00
Robert Boone
a2f22dbfa3 Define NO_MEMMEM of FreeBSD as it lacks the function
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-12 12:57:18 -07:00
Nicolas Pitre
3c70183918 threaded delta search: proper locking for cache accounting
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-12 12:56:09 -07:00
Jean-Luc Herren
6143fa2c9c stash: end index commit log with a newline
There was no newline at the end of the index commit message, putting
the shell prompt at its end after a 'git cat-file commit $id'.  This is
similar to what was fixed in 843103d69388a5c74ed99753e1c162a66835b04d.

Signed-off-by: Jean-Luc Herren <jlh@gmx.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-12 12:05:56 -07:00
Dmitry V. Levin
4fb5fd5d30 git-commit: Disallow amend if it is going to produce an empty non-merge commit
Right now one can amend the last non-merge commit using a dirty index
and in the process maybe cause the last commit to have the same tree
as its parent.  In such a case one would want to discard the last commit
instead of amending it.

This reverts commit 8588452ceb78b1da17652ba03f9942ef740e07ea.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-12 10:50:27 -07:00
David Kastrup
3803bceae8 git-send-email.perl: Add angle brackets to In-Reply-To if necessary
Although message-id by defintion should have surrounding angle
brackets, there is no point forcing people to type them in.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-12 00:57:38 -07:00
Ramsay Jones
060fe57184 Fix a test failure (t9500-*.sh) on cygwin
On filesystems where it is appropriate to set core.filemode
to false, test 29 ("commitdiff(0): mode change") fails when
git-commit does not notice a file (execute) permission change.

A fix requires noting the new file execute permission in the
index with a "git update-index --chmod=+x", prior to the commit.
Add a function (note_chmod) which implements this idea, and
insert a call in each test that modifies the x permission.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-11 23:05:35 -07:00
Shawn O. Pearce
63c4024ff0 git-gui: Don't delete send on Windows as it doesn't exist
The Windows port of Tk does not have the send command so we
cannot delete it from our global namespace, but the Mac OS
X and X11 ports do have it.  Switching this delete attempt
into a catch makes send go away, or stay away.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-11 18:57:18 -04:00
Nicolas Pitre
693b86fffb threaded delta search: add pack.threads config variable
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-10 10:50:21 -07:00
Nicolas Pitre
b81d9af71e fix threaded delta search locking
Found by Jeff King.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-10 10:49:11 -07:00
Junio C Hamano
6972ab7ae1 Merge branch 'rs/archive'
* rs/archive:
  archive - leakfix for format_subst()
  Define NO_MEMMEM on Darwin as it lacks the function
  archive: rename attribute specfile to export-subst
  archive: specfile syntax change: "$Format:%PLCHLDR$" instead of just "%PLCHLDR" (take 2)
  add memmem()
  Remove unused function convert_sha1_file()
  archive: specfile support (--pretty=format: in archive files)
  Export format_commit_message()
2007-09-10 00:14:50 -07:00
Junio C Hamano
20fbfd869f archive - leakfix for format_subst()
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-10 00:14:38 -07:00
Junio C Hamano
9784c5c53e Merge branch 'sp/maint-no-thin'
* sp/maint-no-thin:
  Make --no-thin the default in git-push to save server resources
  fix doc for --compression argument to pack-objects
  git-tag -s must fail if gpg cannot sign the tag.
2007-09-10 00:00:39 -07:00
Shawn O. Pearce
a4503a15af Make --no-thin the default in git-push to save server resources
1) pushes happen less often than fetches, so the bandwidth saving is
   much less visible in that case overall.

2) thin packs have to be complemented with missing delta bases to be
   valid, so many received thin packs will take more disk space.

3) the bother of repacking should be distributed amongst "clients"
   i.e. fetchers and pushers as much as possible, and not the server
   being fetched or pushed, to keep disk and CPU usage low on the
   server.

This is why a fetch should get thin packs but a push should not.

Both Nico and I have been assuming that --no-thin was the default
behavior of git-push ever since Nico introduced --fix-thin into the
index-pack process, which allowed fetch and receive-pack to avoid
exploding packfiles received during transfer.  This patch finally
makes it so.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-10 00:00:26 -07:00
Nicolas Pitre
05cc2ffc57 fix doc for --compression argument to pack-objects
Remove obsolete details (core.legacyheaders is always true now).

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-09 23:58:56 -07:00
Nicolas Pitre
367f4a4343 threaded delta search: specify number of threads at run time
This adds a --threads=<n> parameter to 'git pack-objects' with
documentation.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-09 22:26:06 -07:00
Nicolas Pitre
59921b4b3f threaded delta search: better chunck split point
Try to keep object with the same name hash together.

Suggested by Martin Koegler.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-09 22:25:43 -07:00
Nicolas Pitre
c2a33679a7 threaded delta search: refine work allocation
With this, each thread get repeatedly assigned the next available chunk of
objects to process until the whole list is done.  The idea is to have
reasonably small chunks so that all CPUs remain busy with a minimum
number of threads for as long as there is data to process.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-09 22:25:33 -07:00
Carlos Rica
aba91192ae git-tag -s must fail if gpg cannot sign the tag.
Most of this patch code and message was written by Shawn O. Pearce.
I made some tests to know what the problem was, and then I changed
the code related with the SIGPIPE signal.

If the user has misconfigured `user.signingkey` in their .git/config
or just doesn't have any secret keys on their keyring and they ask
for a signed tag with `git tag -s` we better make sure the resulting
tag was actually signed by gpg.

Prior versions of builtin git-tag allowed this failure to slip
by without error as they were not checking the return value of
the finish_command() so they did not notice when gpg exited with
an error exit status.  They also did not fail if gpg produced an
empty output or if read_in_full received an error from the read
system call while trying to read the pipe back from gpg.

Finally, we did not actually honor any return value from the do_sign
function as it returns ssize_t but was being stored into an unsigned
long.  This caused the compiler to optimize out the die condition,
allowing git-tag to continue along and create the tag object.

However, when gpg gets a wrong username, it exits before any read was done
and then the writing process receives SIGPIPE and program is terminated.
By ignoring this signal, anyway, the function write_or_die gets EPIPE from
write_in_full and exits returning 0 to the system without a message.
Here we better call to write_in_full directly so we can fail
printing a message and return safely to the caller.

With these issues fixed `git-tag -s` will now fail to create the
tag and will report a non-zero exit status to its caller, thereby
allowing automated helper scripts to detect (and recover from)
failure if gpg is not working properly.

Proposed-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-09 21:30:54 -07:00
Shawn O. Pearce
8938410189 git-gui: Trim trailing slashes from untracked submodule names
Oddly enough `git ls-files --others` supplies us the name of an
untracked submodule by including the trailing slash but that
same git version will not accept the name with a trailing slash
through `git update-index --stdin`.  Stripping off that final
slash character before loading it into our file lists allows
git-gui to stage changes to submodules just like any other file.

This change should give git-gui users some basic submodule support,
but it is strictly at the plumbing level as we do not actually know
about calling the git-submodule porcelain that is a recent addition
to git 1.5.3.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-09 20:39:47 -04:00
Shawn O. Pearce
3b9dfde3d6 git-gui: Assume untracked directories are Git submodules
If `git ls-files --others` returned us the name of a directory then
it is because Git has decided that this directory itself contains a
valid Git repository and its files shouldn't be listed as untracked
for this repository.

In such a case we should label the object as a Git repository and
not just as a directory.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-09 20:39:42 -04:00
David Kastrup
02e665ce49 diff-delta.c: Rationalize culling of hash buckets
The previous hash bucket culling resulted in a somewhat unpredictable
number of hash bucket entries in the order of magnitude of HASH_LIMIT.

Replace this with a Bresenham-like algorithm leaving us with exactly
HASH_LIMIT entries by uniform culling.

Signed-off-by: David Kastrup <dak@gnu.org>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-09 17:16:49 -07:00