summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'jc/autogc'Junio C Hamano2007-10-0311-14/+276
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/autogc: git-gc --auto: run "repack -A -d -l" as necessary. git-gc --auto: restructure the way "repack" command line is built. git-gc --auto: protect ourselves from accumulated cruft git-gc --auto: add documentation. git-gc --auto: move threshold check to need_to_gc() function. repack -A -d: use --keep-unreachable when repacking pack-objects --keep-unreachable Export matches_pack_name() and fix its return value Invoke "git gc --auto" from commit, merge, am and rebase. Implement git gc --auto
| * git-gc --auto: run "repack -A -d -l" as necessary.Junio C Hamano2007-09-173-7/+66
| | | | | | | | | | | | | | | | | | | | | | This teaches "git-gc --auto" to consolidate many packs into one without losing unreachable objects in them by using "repack -A" when there are too many packfiles that are not marked with *.keep in the repository. gc.autopacklimit configuration can be used to set the maximum number of packs a repository is allowed to have before this mechanism kicks in. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-gc --auto: restructure the way "repack" command line is built.Junio C Hamano2007-09-171-5/+10
| | | | | | | | | | | | | | | | We used to build the command line to run repack outside of need_to_gc() but with the next patch we would want to tweak the command line depending on the nature of need. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-gc --auto: protect ourselves from accumulated cruftJunio C Hamano2007-09-171-8/+17
| | | | | | | | | | | | | | | | | | | | | | Deciding to run "repack -d -l" when there are too many loose objects would backfire when there are too many loose objects that are unreachable, because repacking that way would never improve the situation. Detect that case by checking the number of loose objects again after automatic garbage collection runs, and issue an warning to run "prune" manually. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-gc --auto: add documentation.Junio C Hamano2007-09-172-1/+17
| | | | | | | | | | | | | | This documents the auto-packing of loose objects performed by git-gc --auto. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-gc --auto: move threshold check to need_to_gc() function.Junio C Hamano2007-09-171-2/+7
| | | | | | | | | | | | | | That is where we decide if we are going to run gc automatically. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * repack -A -d: use --keep-unreachable when repackingJunio C Hamano2007-09-171-3/+11
| | | | | | | | | | | | | | This is a safer variant of "repack -a -d" that does not drop unreachable objects that are in packs. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * pack-objects --keep-unreachableJunio C Hamano2007-09-171-2/+93
| | | | | | | | | | | | | | | | | | | | | | This new option is meant to be used in conjunction with the options "git repack -a -d" usually invokes the underlying pack-objects with. When this option is given, objects unreachable from the refs in packs named with --unpacked= option are added to the resulting pack, in addition to the reachable objects that are not in packs marked with *.keep files. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Export matches_pack_name() and fix its return valueJunio C Hamano2007-09-172-7/+8
| | | | | | | | | | | | | | The function sounds boolean; make it behave as one, not "0 for success, non-zero for failure". Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Invoke "git gc --auto" from commit, merge, am and rebase.Junio C Hamano2007-09-064-0/+6
| | | | | | | | | | | | | | | | The point of auto gc is to pack new objects created in loose format, so a good rule of thumb is where we do update-ref after creating a new commit. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Implement git gc --autoJunio C Hamano2007-09-061-1/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements a new option "git gc --auto". When gc.auto is set to a positive value, and the object database has accumulated roughly that many number of loose objects, this runs a lightweight version of "git gc". The primary difference from the full "git gc" is that it does not pass "-a" option to "git repack", which means we do not try to repack _everything_, but only repack incrementally. We still do "git prune-packed". The default threshold is arbitrarily set by yours truly to: - not trigger it for fully unpacked git v0.99 history; - do trigger it for fully unpacked git v1.0.0 history; - not trigger it for incremental update to git v1.0.0 starting from fully packed git v0.99 history. This patch does not add invocation of the "auto repacking". It is left to key Porcelain commands that could produce tons of loose objects to add a call to "git gc --auto" after they are done their work. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'je/hooks'Junio C Hamano2007-10-033-0/+100
|\ \ | | | | | | | | | | | | * je/hooks: post-checkout hook, tests, and docs
| * | post-checkout hook, tests, and docsJosh England2007-09-293-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | Updated post-checkout hook to take a flag specifying whether the checkout is a branch checkout or a file checkout (from the index). Signed-off-by: Josh England <jjengla@sandia.gov> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'ap/dateformat'Junio C Hamano2007-10-036-24/+209
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ap/dateformat: Add a test script for for-each-ref, including test of date formatting dateformat: parse %(xxdate) %(yydate:format) correctly Make for-each-ref's grab_date() support per-atom formatting Make for-each-ref allow atom names like "<name>:<something>" parse_date_format(): convert a format name to an enum date_mode
| * | | Add a test script for for-each-ref, including test of date formattingAndy Parkins2007-10-031-0/+151
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | dateformat: parse %(xxdate) %(yydate:format) correctlyJunio C Hamano2007-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Andy Parkins noticed that parsing of the above would not correctly notice that xxdate does not have any format specifier. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Make for-each-ref's grab_date() support per-atom formattingAndy Parkins2007-09-292-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | grab_date() gets an extra parameter - atomname; this extra parameter is checked to see if it has a ":<format>" extra component in it, and if so that "<format>" string is passed to parse_date_format() to produce an enum date_mode value which is then further passed to show_date(). In short it allows the user of git-for-each-ref to do things like this: $ git-for-each-ref --format='%(taggerdate:default)' refs/tags/v1.5.2 Sun May 20 00:30:42 2007 -0700 $ git-for-each-ref --format='%(taggerdate:relative)' refs/tags/v1.5.2 4 months ago $ git-for-each-ref --format='%(taggerdate:short)' refs/tags/v1.5.2 2007-05-20 $ git-for-each-ref --format='%(taggerdate:local)' refs/tags/v1.5.2 Sun May 20 08:30:42 2007 $ git-for-each-ref --format='%(taggerdate:iso8601)' refs/tags/v1.5.2 2007-05-20 00:30:42 -0700 $ git-for-each-ref --format='%(taggerdate:rfc2822)' refs/tags/v1.5.2 Sun, 20 May 2007 00:30:42 -0700 The default, when no ":<format>" is specified is ":default", leaving the existing behaviour unchanged. Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Make for-each-ref allow atom names like "<name>:<something>"Andy Parkins2007-09-291-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In anticipation of supplying a per-field date format specifier, this patch makes parse_atom() in builtin-for-each-ref.c allow atoms that have a valid atom name (as determined by the valid_atom[] table) followed by a colon, followed by an arbitrary string. The arbitrary string is where the format for the atom will be specified. Note, if different formats are specified for the same atom, multiple entries will be made in the used_atoms table to allow them to be distinguished by the grab_XXXX() functions. Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | parse_date_format(): convert a format name to an enum date_modeAndy Parkins2007-09-293-16/+22
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out the code to parse --date=<format> parameter to revision walkers into a separate function, parse_date_format(). This function is passed a string and converts it to an enum date_format: - "relative" => DATE_RELATIVE - "iso8601" or "iso" => DATE_ISO8601 - "rfc2822" => DATE_RFC2822 - "short" => DATE_SHORT - "local" => DATE_LOCAL - "default" => DATE_NORMAL In the event that none of these strings is found, the function die()s. Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Sync with GIT 1.5.3.4Junio C Hamano2007-10-0315-29/+149
|\ \ \ | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | GIT 1.5.3.4v1.5.3.4Junio C Hamano2007-10-032-11/+18
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Add test case for ls-files --with-treeCarl Worth2007-10-031-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This tests basic functionality and also exercises a bug noticed by Keith Packard, (prune_cache followed by add_index_entry can trigger an attempt to realloc a pointer into the middle of an allocated buffer). Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Must not modify the_index.cache as it may be passed to realloc at some point.Keith Packard2007-10-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The index cache is not static, growing as new entries are added. If entries are added after prune_cache is called, cache will no longer point at the base of the allocation, and realloc will not be happy. I verified that this was the only place in the current source which modified any index_state.cache elements aside from the alloc/realloc calls in read-cache by changing the type of the element to 'struct cache_entry ** const cache' and recompiling. A more efficient patch would create a separate 'cache_base' value to track the allocation and then fix things up when reallocation was necessary, instead of the brute-force memmove used here. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | the ar tool is called gar on some systemsRobert Schiele2007-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some systems that have only installed the GNU toolchain (prefixed with "g") do not provide "ar" but only "gar". Make configure find this tool as well. Signed-off-by: Robert Schiele <rschiele@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | rename diff_free_filespec_data_large() to diff_free_filespec_blob()Junio C Hamano2007-10-023-5/+5
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | diffcore-rename: cache file deltasJeff King2007-10-023-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We find rename candidates by computing a fingerprint hash of each file, and then comparing those fingerprints. There are inherently O(n^2) comparisons, so it pays in CPU time to hoist the (rather expensive) computation of the fingerprint out of that loop (or to cache it once we have computed it once). Previously, we didn't keep the filespec information around because then we had the potential to consume a great deal of memory. However, instead of keeping all of the filespec data, we can instead just keep the fingerprint. This patch implements and uses diff_free_filespec_data_large to accomplish that goal. We also have to change estimate_similarity not to needlessly repopulate the filespec data when we already have the hash. Practical tests showed 4.5x speedup for a 10% memory usage increase. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Mention 'cpio' dependency in INSTALLJohan Herland2007-10-021-0/+3
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Make git-pull complain and give advice when there is nothing to merge withFederico Mena Quintero2007-10-021-4/+18
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Note that git-branch will not automatically checkout the new branchFederico Mena Quintero2007-10-021-0/+4
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Add documentation for --track and --no-track to the git-branch docs.Federico Mena Quintero2007-10-021-0/+15
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Federico Mena Quintero <federico@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Say when --track is useful in the git-checkout docs.Federico Mena Quintero2007-10-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation used to say what the option does, but it didn't mention a use case. Signed-off-by: Federico Mena Quintero <federico@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Fix typo in config.txtJohannes Schindelin2007-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There was an 'l' (ell) instead of a '1' (one) in one of the gitlinks. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | for-each-ref: fix %(numparent) and %(parent)Junio C Hamano2007-10-021-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The string value of %(numparent) was not returned correctly. Also %(parent) misbehaved for the root commits (returned garbage) and merge commits (returned first parent, followed by a space). Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | git-commit: initialize TMP_INDEX just to be sure.Junio C Hamano2007-10-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We rely on TMP_INDEX variable to decide if we are doing a partial commit, as it is only set in the partial commit codepath. But the variable is never initialized. A stray environment variable from outside could ruin the day. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | fixed link in documentation of diff-optionsSteffen Prohaska2007-10-011-2/+2
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'maint'Junio C Hamano2007-10-014-8/+34
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | * maint: Whip post 1.5.3.3 maintenance series into shape. git stash: document apply's --index switch post-receive-hook: Remove the From field from the generated email header so that the pusher's name is used
| * | | Whip post 1.5.3.3 maintenance series into shape.Junio C Hamano2007-10-014-8/+30
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | git stash: document apply's --index switchMiklos Vajna2007-10-011-1/+6
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | post-receive-hook: Remove the From field from the generated email header so ↵Andy Parkins2007-10-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that the pusher's name is used Using the name of the committer of the revision at the tip of the updated ref is not sensible. That information is available in the email itself should it be wanted, and by supplying a "From", we were effectively hiding the person who performed the push - which is useful information in itself. Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Update stale documentation link in the k.org siteJunio C Hamano2007-09-301-0/+1
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | git.el: Reset the permission flags when changing a file state.Alexandre Julliard2007-09-291-17/+11
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | git.el: Update a file status in the git buffer upon save.Alexandre Julliard2007-09-291-2/+16
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | git.el: Do not print a status message on every git command.Alexandre Julliard2007-09-291-29/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead print a single message around sequences of commands that can potentially take some time. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | git.el: Preserve file marks when doing a full refresh.Alexandre Julliard2007-09-291-12/+28
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Fix adding a submodule with a remote urlDaniel Barkalow2007-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this, a non-path URL gets lost before the clone. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | git-remote: exit with non-zero status after detecting error in "rm".Jari Aalto2007-09-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exit with non-zero status when "git remote rm" was told to remove a non-existing remote. Signed-off-by: Jari Aalto <jari.aalto@cante.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'maint'Junio C Hamano2007-09-295-12/+22
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | * maint: git-remote: exit with non-zero status after detecting errors. rebase -i: squash should retain the authorship of the _first_ commit git-add--interactive: Improve behavior on bogus input git-add--interactive: Allow Ctrl-D to exit
| * | | git-remote: exit with non-zero status after detecting errors.Jari Aalto2007-09-291-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some subcommands of "git-remote" detected and issued error messages but did not signal that to the calling process with exit status. Signed-off-by: Jari Aalto <jari.aalto@cante.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | rebase -i: squash should retain the authorship of the _first_ commitJohannes Schindelin2007-09-293-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was determined on the mailing list, that it makes more sense for a "squash" to keep the author of the first commit as the author for the result of the squash. Make it so. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | git-add--interactive: Improve behavior on bogus inputJean-Luc Herren2007-09-291-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Previously, any menu would cause a perl error when entered '0', which is never a valid option. 2) Entering a bogus choice (like 998 or 4-2) surprisingly caused the same behavior as if the user had just hit 'enter', which means to carry out the selected action on the selected items. Entering such bogus input is now a no-op and the sub-menu doesn't exit. Signed-off-by: Jean-Luc Herren <jlh@gmx.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>