aboutsummaryrefslogtreecommitdiff
path: root/t/t1300-repo-config.sh
Commit message (Collapse)AuthorAge
* Improve error messages when int/long cannot be parsed from configShawn O. Pearce2007-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a config file has become mildly corrupted due to a missing LF we may discover some other option joined up against the end of a numeric value. For example: [section] number = 1auto where the "auto" flag was meant to occur on the next line, below "number", but the missing LF has caused it to no longer be its own option. Instead the word "auto" is parsed as a 'unit factor' for the value of "number". Before this change we got the confusing error message: fatal: unknown unit: 'auto' which told us nothing about where the problem appeared. Now we get: fatal: bad config value for 'aninvalid.unit' which at least points the user in the right direction of where to search for the incorrectly formatted configuration file. Noticed by erikh on #git, which received the original error from a simple `git checkout -b` due to a midly corrupted config. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* the use of 'tr' in the test suite isn't really portableH.Merijn Brand2007-12-17
| | | | | | | | | | Some versions of 'tr' only accept octal codes if entered with three digits, and therefor misinterpret the '\0' in the test suite. Some versions of 'tr' reject the (needless) use of character classes. Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add a test for git-config --fileAlex Riesen2007-07-31
| | | | | | | | Check for non-0 exit code if the confiog file does not exist and if it works exactly like when setting GIT_CONFIG. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add test for symlinked configuration file updates.Junio C Hamano2007-07-27
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Rewrite "git-frotz" to "git frotz"Junio C Hamano2007-07-02
| | | | | | This uses the remove-dashes target to replace "git-frotz" to "git frotz". Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'fl/config'Junio C Hamano2007-06-30
|\ | | | | | | | | * fl/config: config: add support for --bool and --int while setting values
| * config: add support for --bool and --int while setting valuesFrank Lichtenheld2007-06-26
| | | | | | | | | | Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Avoid perl in t1300-repo-configAlex Riesen2007-06-28
|/ | | | | | | It fixes the test on system where ActiveState Perl is used. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* config: Add --null/-z option for null-delimted outputFrank Lichtenheld2007-06-26
| | | | | | | | | Use \n as delimiter between key and value and \0 as delimiter after each key/value pair. This should be easily parsable output. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint'Junio C Hamano2007-06-26
|\ | | | | | | | | | | | | | | | | * maint: config: Change output of --get-regexp for valueless keys config: Complete documentation of --get-regexp cleanup merge-base test script Fix zero-object version-2 packs Ignore submodule commits when fetching over dumb protocols
| * config: Change output of --get-regexp for valueless keysFrank Lichtenheld2007-06-26
| | | | | | | | | | | | | | | | | | Print no space after the name of a key without value. Otherwise keys without values are printed exactly the same as keys with empty values. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | War on whitespaceJunio C Hamano2007-06-07
|/ | | | | | | | | This uses "git-apply --whitespace=strip" to fix whitespace errors that have crept in to our source files over time. There are a few files that need to have trailing whitespaces (most notably, test vectors). The results still passes the test, and build result in Documentation/ area is unchanged. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t1300: Add tests for git-config --bool --getFrank Lichtenheld2007-05-20
| | | | | | | | 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>
* git-config: test for 'do not forget "a.b.var" ends "a.var" section'.Steffen Prohaska2007-05-13
| | | | | | | Added test for mentioned bugfix. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'js/diff-ni'Junio C Hamano2007-03-10
|\ | | | | | | | | | | | | | | * js/diff-ni: Get rid of the dependency to GNU diff in the tests diff --no-index: support /dev/null as filename diff-ni: fix the diff with standard input diff: support reading a file from stdin via "-"
| * Get rid of the dependency to GNU diff in the testsJohannes Schindelin2007-03-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that "git diff" handles stdin and relative paths outside the working tree correctly, we can convert all instances of "diff -u" to "git diff". This commit is really the result of $ perl -pi.bak -e 's/diff -u/git diff/' $(git grep -l "diff -u" t/) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from commit c699a40d68215c7e44a5b26117a35c8a56fbd387)
* | git-config: document --rename-section, provide --remove-sectionPaolo Bonzini2007-03-03
|/ | | | | | | | | This patch documents the previously undocumented option --rename-section and adds a new option to zap an entire section. Signed-off-by: Paolo Bonzini <bonzini@gnu.org> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Rename git-repo-config to git-config.Tom Prince2007-01-28
| | | | | Signed-off-by: Tom Prince <tom.prince@ualberta.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* t/t1300-repo-config.sh: value continued on next lineJakub Narebski2007-01-23
| | | | | | | | | | | Documentation/config.txt: Variable value ending in a '`\`' is continued on the next line in the customary UNIX fashion. Test it. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* config_set_multivar(): disallow newlines in keysJohannes Schindelin2007-01-19
| | | | | | | | | This will no longer work: $ git repo-config 'key.with newline' some-value Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
* Auto-quote config values in config.c:store_write_pair()Brian Gernhardt2007-01-08
| | | | | | | | | | | | Suggested by Jakub Narebski <jnareb@gmail.com> on the list. When we send a value to store_write_pair(), make sure that the value that gets read out matches the one passed in. This means that for any value that contains leading or trailing whitespace or any comment character (# and ;), we need to surround it in quotes. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Teach Git how to parse standard power of 2 suffixes.Shawn O. Pearce2006-12-30
| | | | | | | | | | | | | | | Sometimes its necessary to supply a value as a power of two in a configuration parameter. In this case the user may want to use the standard suffixes such as K, M, or G to indicate that the numerical value should be multiplied by a constant base before being used. Shell scripts/etc. can also benefit from this automatic option parsing with `git repo-config --int`. [jc: with a couple of test and a slight input tightening] Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* add a function to rename sections in the configJohannes Schindelin2006-12-16
| | | | | | | | | | | | | | | | | | | | | Given a config like this: # A config [very.interesting.section] not The command $ git repo-config --rename-section very.interesting.section bla.1 will lead to this config: # A config [bla "1"] not Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add --add option to git-repo-configBrian Gernhardt2006-12-15
| | | | | | | | | | | | | | | For multivars, the "git-repo-config name value ^$" is useful but nonintuitive and troublesome to do repeatedly (since the value is not at the end of the command line). This commit simply adds an --add option that adds a new value to a multivar. Particularly useful for tracking a new branch on a remote: git-repo-config --add remote.origin.fetch +next:origin/next Includes documentation and test. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix setting config variables with an alternative GIT_CONFIGJohannes Schindelin2006-06-19
| | | | | | | | | | | | | When setting a config variable, git_config_set() ignored the variables GIT_CONFIG and GIT_CONFIG_LOCAL. Now, when GIT_CONFIG_LOCAL is set, it will write to that file. If not, GIT_CONFIG is checked, and only as a fallback, the change is written to $GIT_DIR/config. Add a test for it, and also future-proof the test for the upcoming $HOME/.gitconfig support. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'fix'Junio C Hamano2006-05-15
|\ | | | | | | | | | | | | | | | | | | * fix: Fix pack-index issue on 64-bit platforms a bit more portably. Install git-send-email by default Fix compilation on newer NetBSD systems git config syntax updates Another config file parsing fix. checkout: use --aggressive when running a 3-way merge (-m).
| * git config syntax updatesLinus Torvalds2006-05-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates the hierarchical section name syntax to [section<space>+"<randomstring>"] where the only rule for "randomstring" is that it can't contain a newline, and if you really want to insert a double-quote, you do it with \". It turns that into the section name "secion.randomstring". The "section" part is still case insensitive, but the "randomstring" part is case sensitive. So you could use this for things like [email "torvalds@osdl.org"] name = Linus Torvalds if you wanted to do the "email->name" conversion as part of the config file format (I'm not claiming that is sensible, I'm just giving it as an insane example). That would show up as the association email.torvalds@osdl.org.name -> Linus Torvalds which is easy to parse (the "." in the email _looks_ ambiguous, but it isn't: you know that there will always be a single key-name, so you find the key name with "strrchr(name, '.')" and things are entirely unambiguous). Repo-config is updated to be able to parse the new format, and also write things out in the new format. [jc: rolled two patches from Linus and one fix-up from Sean into one, with additional adjustments for t/t1300 test to check the case insensitiveness of section base and variable and case sensitiveness of the extended section part. Then stripped some part off to make the result applicable to the stale 1.3.X series that does not have recent enhancements. ] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | t1300-repo-config: two new config parsing tests.sean2006-05-06
| | | | | | | | | | | | | | | | | | | | | | - correctly insert a new variable into a section that only contains a single (different) variable. - correctly insert a new section that matches the initial substring of an existing section. Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | repo-config: support --get-regexpJohannes Schindelin2006-05-02
|/ | | | | | | | | | | | | | | With --get-regexp, output all key/value pairs where the key matches a regexp. Example: git-repo-config --get-regexp remote.*.url will output something like remote.junio.url git://git.kernel.org/pub/scm/git/git.git remote.gitk.url git://git.kernel.org/pub/scm/gitk/gitk.git Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* repo-config: give value_ a sane default so regexec won't segfaultJonas Fonseca2006-03-07
| | | | | Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* tests: make scripts executableJunio C Hamano2005-12-19
| | | | | | just for consistency. Signed-off-by: Junio C Hamano <junkio@cox.net>
* config.c: remove unnecessary header in minimum configuration file.Junio C Hamano2005-12-05
| | | | | | | It is just silly to start the file called "config" with a comment that says "This is the config file." Signed-off-by: Junio C Hamano <junkio@cox.net>
* Rename git-config-set to git-repo-configJohannes Schindelin2005-11-24
... and adjust all references. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>