summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2007-10-30Fixed a command line option type for builtin-fsck.cLibravatar Emil Medve1-1/+1
The typo was introduced by 5ac0a2063e8f824f6e8ffb4d18de74c55aae7131 (Make builtin-fsck.c use parse_options.) Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Acked-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-29Make builtin-pack-refs.c use parse_options.Libravatar Pierre Habouzit1-27/+20
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Make builtin-name-rev.c use parse_options.Libravatar Pierre Habouzit1-39/+25
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Make builtin-count-objects.c use parse_options.Libravatar Pierre Habouzit1-17/+15
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Make builtin-fsck.c use parse_options.Libravatar Pierre Habouzit1-54/+26
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Update manpages to reflect new short and long option aliasesLibravatar Jonas Fonseca5-7/+7
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Make builtin-for-each-ref.c use parse-opts.Libravatar Pierre Habouzit2-77/+61
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Make builtin-symbolic-ref.c use parse_options.Libravatar Pierre Habouzit1-34/+18
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Make builtin-update-ref.c use parse_optionsLibravatar Pierre Habouzit1-40/+25
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Make builtin-revert.c use parse_options.Libravatar Pierre Habouzit1-37/+30
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Make builtin-describe.c use parse_optionsLibravatar Pierre Habouzit1-41/+29
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Make builtin-branch.c use parse_options.Libravatar Pierre Habouzit1-95/+52
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Make builtin-mv.c use parse-optionsLibravatar Pierre Habouzit1-49/+35
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Make builtin-rm.c use parse_options.Libravatar Pierre Habouzit1-31/+23
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Port builtin-add.c to use the new option parser.Libravatar Kristian Høgsberg1-46/+27
Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29parse-options: allow callbacks to take no arguments at all.Libravatar Pierre Habouzit2-1/+10
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29parse-options: Allow abbreviated options when unambiguousLibravatar Johannes Schindelin2-0/+60
When there is an option "--amend", the option parser now recognizes "--am" for that option, provided that there is no other option beginning with "--am". Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Add shortcuts for very often used options.Libravatar Pierre Habouzit2-0/+32
It helps with consistency of the help strings, for example. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29parse-options: make some arguments optional, add callbacks.Libravatar Pierre Habouzit2-8/+53
* add the possibility to use callbacks to parse some options, this can help implementing new options kinds with great flexibility. struct option gains a callback pointer and a `defval' where callbacks user can put either integers or pointers. callbacks also can use the `value' pointer for anything, preferably to the pointer to the final storage for the value though. * add a `flag' member to struct option to make explicit that this option may have an optional argument. The semantics depends on the option type. For INTEGERS, it means that if the switch is not used in its --long-form=<value> form, and that there is no token after it or that the token does not starts with a digit, then it's assumed that the switch has no argument. For STRING or CALLBACK it works the same, except that the condition is that the next atom starts with a dash. This is needed to implement backward compatible behaviour with existing ways to parse the command line. Its use for new options is discouraged. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Rework make_usage to print the usage message immediatelyLibravatar Alex Riesen1-25/+22
Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Add tests for parse-options.cLibravatar Johannes Schindelin4-1/+107
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29parse-options: be able to generate usages automaticallyLibravatar Pierre Habouzit2-9/+79
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Add a simple option parser.Libravatar Pierre Habouzit3-2/+204
The option parser takes argc, argv, an array of struct option and a usage string. Each of the struct option elements in the array describes a valid option, its type and a pointer to the location where the value is written. The entry point is parse_options(), which scans through the given argv, and matches each option there against the list of valid options. During the scan, argv is rewritten to only contain the non-option command line arguments and the number of these is returned. Aggregation of single switches is allowed: -rC0 is the same as -r -C 0 (supposing that -C wants an arg). Every long option automatically support the option with the same name, prefixed with 'no-' to unset the switch. It assumes that initial value for strings are "NULL" and for integers is "0". Long options are supported either with '=' or without: --some-option=foo is the same as --some-option foo Acked-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-29Correct handling of upload-pack in builtin-fetch-packLibravatar Daniel Barkalow1-3/+4
The field in the args was being ignored in favor of a static constant Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Thanked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-29Speedup scanning for excluded files.Libravatar Lars Knoll2-16/+50
Try to avoid a lot of work scanning for excluded files, by caching some more information when setting up the exclusion data structure. Speeds up 'git runstatus' on a repository containing the Qt sources by 30% and reduces the amount of instructions executed (as measured by valgrind) by a factor of 2. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-29RelNotes-1.5.4: describe recent updatesLibravatar Junio C Hamano2-2/+27
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-29Teach git-pull about --[no-]ff, --no-squash and --commitLibravatar Lars Hjemli1-3/+11
These options are supported by git-merge, but git-pull didn't know about them. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-29Merge branch 'maint'Libravatar Junio C Hamano6-12/+39
* maint: RelNotes-1.5.3.5: describe recent fixes merge-recursive.c: mrtree in merge() is not used before set sha1_file.c: avoid gcc signed overflow warnings Fix a small memory leak in builtin-add honor the http.sslVerify option in shell scripts
2007-10-29Remove outdated references to cogito in documentationLibravatar Dan McGee1-1/+4
Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-29RelNotes-1.5.3.5: describe recent fixesLibravatar Junio C Hamano1-0/+21
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-29merge-recursive.c: mrtree in merge() is not used before setLibravatar Junio C Hamano1-1/+1
The called function merge_trees() sets its *result, to which the address of the variable mrtree in merge() function is passed, only when index_only is set. But that is Ok as the function uses the value in the variable only under index_only iteration. However, recent gcc does not realize this. Work it around by adding a fake initializer. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-29sha1_file.c: avoid gcc signed overflow warningsLibravatar Junio C Hamano1-7/+9
With the recent gcc, we get: sha1_file.c: In check_packed_git_: sha1_file.c:527: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false sha1_file.c:527: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false for a piece of code that tries to make sure that off_t is large enough to hold more than 2^32 offset. The test tried to make sure these do not wrap-around: /* make sure we can deal with large pack offsets */ off_t x = 0x7fffffffUL, y = 0xffffffffUL; if (x > (x + 1) || y > (y + 1)) { but gcc assumes it can do whatever optimization it wants for a signed overflow (undefined behaviour) and warns about this construct. Follow Linus's suggestion to check sizeof(off_t) instead to work around the problem. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-29core-tutorial: Catch up with current GitLibravatar Benoit Sigoure1-16/+10
No longer talk about Cogito since it's deprecated. Some scripts (such as git-reset or git-branch) have undergone builtinification so adjust the text to reflect this. Fix a typo in the description of git-show-branch (merges are indicated by a `-', not by a `.'). git-pull/git-push do not seem to use the dumb git-ssh-fetch/git-ssh-upload (the text was probably missing a word). Adjust a link that wasn't rendered properly because it was wrapped. Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-29Fix a small memory leak in builtin-addLibravatar Benoit Sigoure1-0/+2
prune_directory and fill_directory allocated one byte per pathspec and never freed it. Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-28honor the http.sslVerify option in shell scriptsLibravatar Aurelien Bompard2-4/+6
Signed-off-by: Aurélien Bompard <aurelien@bompard.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-28git.el: Run git-gc --auto after commits.Libravatar Alexandre Julliard1-0/+1
Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-28git.el: Refresh only the changed file marks when marking/unmarking all.Libravatar Alexandre Julliard1-2/+5
Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-28git.el: Fix typo in git-update-saved-file error handling.Libravatar Alexandre Julliard1-1/+1
Spotted by Matthieu Lemerre. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-28git.el: Fix typo in "Reverted file" message.Libravatar Alexandre Julliard1-1/+1
Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-28git-fetch: do not fail when remote branch disappearsLibravatar Junio C Hamano3-18/+33
When the branch named with branch.$name.merge is not covered by the fetch configuration for the remote repository named with branch.$name.remote, we automatically add that branch to the set of branches to be fetched. However, if the remote repository does not have that branch (e.g. it used to exist, but got removed), this is not a reason to fail the git-fetch itself. The situation however will be noticed if git-fetch was called by git-pull, as the resulting FETCH_HEAD would not have any entry that is marked for merging. Acked-By: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-28Merge branch 'master' of git://git.kernel.org/pub/scm/gitk/gitkLibravatar Junio C Hamano1-1091/+1744
* 'master' of git://git.kernel.org/pub/scm/gitk/gitk: (34 commits) gitk: Use the UI font for the diff/old version/new version radio buttons gitk: Simplify the code for finding commits gitk: Fix a couple more bugs in the path limiting gitk: Fix some bugs with path limiting in the diff display gitk: Use the status window for other functions gitk: Integrate the reset progress bar in the main frame gitk: Ensure tabstop setting gets restored by Cancel button gitk: Limit diff display to listed paths by default gitk: Fix Tcl error: can't unset findcurline gitk: Get rid of the diffopts variable gitk: Fix bug where the last few commits would sometimes not be visible gitk: Add a font chooser gitk: Keep track of font attributes ourselves instead of using font actual gitk: Use named fonts instead of the font specification gitk: Fix bug causing Tcl error when changing find match type gitk: Fix the tab setting in the diff display window gitk: Add progress bars for reading in stuff and for finding gitk: Fix a couple of bugs gitk: Simplify highlighting interface and combine with Find function gitk: Fix bug in generating patches ...
2007-10-27gitk: Use the UI font for the diff/old version/new version radio buttonsLibravatar Paul Mackerras1-3/+3
This makes the radio buttons for selecting whether to see the full diff, the old version or the new version use the same font as the other user interface elements. Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-10-27Merge branch 'dev'Libravatar Paul Mackerras1-1076/+1638
2007-10-27gitk: Simplify the code for finding commitsLibravatar Paul Mackerras1-152/+54
This unifies findmore and findmorerev, and adds the ability to do a search with or without wrap around from the end of the list of commits to the beginning (or vice versa for reverse searches). findnext and findprev are gone, and the buttons and keys for searching all call dofind now. dofind doesn't unmark the matches to start with. Shift-up and shift-down are back by popular request, and the searches they do don't wrap around. The other keys that do searches (/, ?, return, M-f) do wrapping searches except for M-g. Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-10-26Merge branch 'ja/shorthelp'Libravatar Junio C Hamano1-2/+1
* ja/shorthelp: help: remove extra blank line after "See 'git --help'" message On error, do not list all commands, but point to --help option
2007-10-26help: remove extra blank line after "See 'git --help'" messageLibravatar Junio C Hamano1-1/+1
The double LF were there only because we gave a list of common commands. WIth the list gone, there is no reason to have the extra blank line. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-26Merge branch 'maint'Libravatar Junio C Hamano2-6/+3
* maint: Fix generation of perl/perl.mak git-remote: fix "Use of uninitialized value in string ne"
2007-10-26Test suite: reset TERM to its previous value after testing.Libravatar Christian Couder1-0/+4
Using konsole, I get no colored output at the end of "t7005-editor.sh" without this patch. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-26Merge branch 'ph/color-test'Libravatar Junio C Hamano1-17/+48
* ph/color-test: Support a --quiet option in the test-suite. Add some fancy colors in the test library when terminal supports it.
2007-10-26hooks-pre-commit: use \t, rather than a literal TAB in regexpLibravatar Jim Meyering1-1/+1
Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>