summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* git p4: avoid shell when invoking git config --get-allPete Wyckoff2013-01-261-1/+2
| | | | | Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4: avoid shell when invoking git rev-listPete Wyckoff2013-01-261-2/+3
| | | | | | | | | | Invoke git rev-list directly, avoiding the shell, in P4Submit and P4Sync. The overhead of starting extra processes is significant in cygwin; this speeds things up on that platform. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4: avoid shell when mapping usersPete Wyckoff2013-01-261-1/+2
| | | | | | | | The extra quoting and double-% are unneeded, just to work around the shell. Instead, avoid the shell indirection. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4: disable read-only attribute before deletingPete Wyckoff2013-01-261-0/+10
| | | | | | | | | | | | | | On windows, p4 marks un-edited files as read-only. Not only are they read-only, but also they cannot be deleted. Remove the read-only attribute before deleting in both the copy and rename cases. This also happens in the RCS cleanup code, where a file is marked to be deleted, but must first be edited to remove adjust the keyword lines. Make sure it is editable before patching. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4 test: use test_chmod for cygwinPete Wyckoff2013-01-261-4/+7
| | | | | | | | | | | | | | | | | | This test does a commit that is a pure mode change, submits it to p4 but causes the submit to fail. It verifies that the state in p4 as well as the client directory are both unmodified after the failed submit. On cygwin, "chmod +x" does nothing, so use the test_chmod function to modify the index directly too. Also on cygwin, the executable bit cannot be seen in the filesystem, so avoid that part of the test. The checks of p4 state are still valid, though. Thanks-to: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4: cygwin p4 client does not mark read-onlyPete Wyckoff2013-01-263-4/+27
| | | | | | | | | | | | | | | | There are some old versions of p4, compiled for cygwin, that treat read-only files differently. Normally, a file that is not open is read-only, meaning that "test -w" on the file is false. This works on unix, and it works on windows using the NT version of p4. The cygwin version of p4, though, changes the permissions, but does not set the windows read-only attribute, so "test -w" returns false. Notice this oddity and make the tests work, even on cygiwn. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4 test: avoid wildcard * in windowsPete Wyckoff2013-01-262-10/+37
| | | | | | | | | This character is not valid in windows filenames, even though it can appear in p4 depot paths. Avoid using it in tests on windows, both mingw and cygwin. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4 test: use LineEnd unix in windows tests tooPete Wyckoff2013-01-261-0/+1
| | | | | | | | | | | | In all clients, even those created on windows, use unix line endings. This makes it possible to verify file contents without doing OS-specific comparisons in all the tests. Tests in t9802-git-p4-filetype.sh are used to make sure that the other LineEnd options continue to work. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4 test: newline handlingPete Wyckoff2013-01-261-0/+117
| | | | | | | | | | | | P4 stores newlines in the depos as \n. By default, git does this too, both on unix and windows. Test to make sure that this stays true. Both git and p4 have mechanisms to use \r\n in the working directory. Exercise these. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4: scrub crlf for utf16 files on windowsPete Wyckoff2013-01-261-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Files of type utf16 are handled with "p4 print" instead of the normal "p4 -G print" interface due to how the latter does not produce correct output. See 55aa571 (git-p4: handle utf16 filetype properly, 2011-09-17) for details. On windows, though, "p4 print" can not be told which line endings to use, as there is no underlying client, and always chooses crlf, even for utf16 files. Convert the \r\n into \n when importing utf16 files. The fix for this is complex, in that the problem is a property of the NT version of p4. There are old versions of p4 that were compiled directly for cygwin that should not be subjected to text replacement. The right check here, then, is to look at the p4 version, not the OS version. Note also that on cygwin, platform.system() is "CYGWIN_NT-5.1" or similar, not "Windows". Add a function to memoize the p4 version string and use it to check for "/NT", indicating the Windows build of p4. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4: remove unreachable windows \r\n conversion codePete Wyckoff2013-01-261-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replacing \r\n with \n on windows was added in c1f9197 (Replace \r\n with \n when importing from p4 on Windows, 2007-05-24), to work around an oddity with "p4 print" on windows. Text files are printed with "\r\r\n" endings, regardless of whether they were created on unix or windows, and regardless of the client LineEnd setting. As of d2c6dd3 (use p4CmdList() to get file contents in Python dicts. This is more robust., 2007-05-23), git-p4 uses "p4 -G print", which generates files in a raw format. As the native line ending format if p4 is \n, there will be no \r\n in the raw text. Actually, it is possible to generate a text file so that the p4 representation includes embedded \r\n, even though this is not normal on either windows or unix. In that case the code would have mistakenly stripped them out, but now they will be left intact. More information on how p4 deals with line endings is here: http://kb.perforce.com/article/63 Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4 test: translate windows paths for cygwinPete Wyckoff2013-01-263-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Native windows binaries do not understand posix-like path mapping offered by cygwin. Convert paths to native using "cygpath --windows" before presenting them to p4d. This is done using the AltRoots mechanism of p4. Both the posix and windows forms are put in the client specification, allowing p4 to find its location by native path even though the environment reports a different PWD. Shell operations in tests will use the normal form of $cli, which will look like a posix path in cygwin, while p4 will use AltRoots to match against the windows form of the working directory. This mechanism also handles the symlink issue that was fixed in 23bd0c9 (git p4 test: use real_path to resolve p4 client symlinks, 2012-06-27). Now that every p4 client view has an AltRoots with the real_path in it, explicitly calculating the real_path elsewhere is not necessary. Thanks-to: Sebastian Schuberth <sschuberth@gmail.com> Thanks-to: Johannes Sixt <j6t@kdbg.org> fixup! git p4 test: translate windows paths for cygwin Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4 test: start p4d inside its db dirPete Wyckoff2013-01-261-2/+5
| | | | | | | | | | This will avoid having to do native path conversion for windows. Also may be a bit cleaner always to know that p4d has that working directory, instead of wherever the function was called from. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4 test: use client_view in t9806Pete Wyckoff2013-01-262-30/+23
| | | | | | | | | | | Use the standard client_view function from lib-git-p4.sh instead of building one by hand. This requires a bit of rework, using the current value of $P4CLIENT for the client name. It also reorganizes the test to isolate changes to $P4CLIENT and $cli in a subshell. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4 test: avoid loop in client_viewPete Wyckoff2013-01-262-4/+2
| | | | | | | | | | | | | | | The printf command re-interprets the format string as long as there are arguments to consume. Use this to simplify a for loop in the client_view() library function. This requires a fix to one of the client_view callers. An errant \n in the string was converted into a harmless newline in the input to "p4 client -i", but now shows up as a literal \n as passed through by "%s". Remove the \n. Based-on-patch-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4 test: use client_view to build the initial clientPete Wyckoff2013-01-261-9/+2
| | | | | | | Simplify the code a bit by using an existing function. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4: generate better error message for bad depot pathPete Wyckoff2013-01-262-0/+6
| | | | | | | | Depot paths must start with //. Exit with a better explanation when a bad depot path is supplied. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4: remove unused importsPete Wyckoff2013-01-261-5/+9
| | | | | | | | | | Found by "pyflakes" checker tool. Modules shelve, getopt were unused. Module os.path is exported by os. Reformat one-per-line as is PEP008 suggested style. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git p4: temp branch name should use / even on windowsPete Wyckoff2013-01-261-1/+1
| | | | | | | | | | | | | | Commit fed2369 (git-p4: Search for parent commit on branch creation, 2012-01-25) uses temporary branches to help find the parent of a new p4 branch. The temp branches are of the form "git-p4-tmp/%d" for some p4 change number. Mistakenly, this string was made using os.path.join() instead of just string concatenation. On windows, this turns into a backslash (\), which is not allowed in git branch names. Reported-by: Casey McGinty <casey.mcginty@gmail.com> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'for-junio' of git://bogomips.org/git-svnJunio C Hamano2013-01-254-26/+25
|\ | | | | | | | | | | * 'for-junio' of git://bogomips.org/git-svn: git-svn: Simplify calculation of GIT_DIR git-svn: cleanup sprintf usage for uppercasing hex
| * git-svn: Simplify calculation of GIT_DIRBarry Wardell2013-01-242-23/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since git-rev-parse already checks for the $GIT_DIR environment variable and that it returns an actual git repository, there is no need to repeat the checks again here. This also fixes a problem where git-svn did not work in cases where .git was a file with a gitdir: link. [ew: squashed test case, delay setting GIT_DIR until after `git rev-parse --cdup` to fix t9101, (thanks to Junio)] Signed-off-by: Barry Wardell <barry.wardell@gmail.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
| * git-svn: cleanup sprintf usage for uppercasing hexEric Wong2013-01-242-3/+3
| | | | | | | | | | | | | | | | We do not need to call uc() separately for sprintf("%x") as sprintf("%X") is available. Signed-off-by: Eric Wong <normalperson@yhbt.net> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
* | Update draft release notes to 1.8.2Junio C Hamano2013-01-251-3/+33
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'nd/retire-fnmatch'Junio C Hamano2013-01-257-62/+249
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace our use of fnmatch(3) with a more feature-rich wildmatch. A handful patches at the bottom have been moved to nd/wildmatch to graduate as part of that branch, before this series solidifies. We may want to mark USE_WILDMATCH as an experimental curiosity a bit more clearly (i.e. should not be enabled in production environment, because it will make the behaviour between builds unpredictable). * nd/retire-fnmatch: Makefile: add USE_WILDMATCH to use wildmatch as fnmatch wildmatch: advance faster in <asterisk> + <literal> patterns wildmatch: make a special case for "*/" with FNM_PATHNAME test-wildmatch: add "perf" command to compare wildmatch and fnmatch wildmatch: support "no FNM_PATHNAME" mode wildmatch: make dowild() take arbitrary flags wildmatch: rename constants and update prototype
| * | Makefile: add USE_WILDMATCH to use wildmatch as fnmatchNguyễn Thái Ngọc Duy2013-01-013-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is similar to NO_FNMATCH but it uses wildmatch instead of compat/fnmatch. This is an intermediate step to let wildmatch be used as fnmatch replacement for wider audience before it replaces fnmatch completely and compat/fnmatch is removed. fnmatch in test-wildmatch is not impacted by this and is the only place that NO_FNMATCH or NO_FNMATCH_CASEFOLD remain active when USE_WILDMATCH is set. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | wildmatch: advance faster in <asterisk> + <literal> patternsNguyễn Thái Ngọc Duy2013-01-012-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally when we match "*X" on "abcX", we call dowild("X", "abcX"), dowild("X", "bcX"), dowild("X", "cX") and dowild("X", "X"). Only the last call may have a chance of matching. By skipping the text before "X", we can eliminate the first three useless calls. compat, '*/*/*' on linux-2.6.git file list 2000 times, before: wildmatch 7s 985049us fnmatch 2s 735541us or 34.26% faster and after: wildmatch 4s 492549us fnmatch 0s 888263us or 19.77% slower Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | wildmatch: make a special case for "*/" with FNM_PATHNAMENguyễn Thái Ngọc Duy2013-01-012-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally we need recursion for "*". In this case we know that it matches everything until "/" so we can skip the recursion. glibc, '*/*/*' on linux-2.6.git file list 2000 times before: wildmatch 8s 74513us fnmatch 1s 97042us or 13.59% faster after: wildmatch 3s 521862us fnmatch 3s 488616us or 99.06% slower Same test with compat/fnmatch: wildmatch 8s 110763us fnmatch 2s 980845us or 36.75% faster wildmatch 3s 522156us fnmatch 1s 544487us or 43.85% slower Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | test-wildmatch: add "perf" command to compare wildmatch and fnmatchNguyễn Thái Ngọc Duy2013-01-011-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It takes a text file, a pattern, a number <n> and pathname flag. Each line in the text file is matched against the pattern <n> times. If "pathname" is given, FNM_PATHNAME is used. test-wildmatch is built with -O2 and tested against glibc 2.14.1 (also -O2) and compat/fnmatch. The input file is linux-2.6.git file list. <n> is 2000. The complete command list is at the end. wildmatch is beaten in the following cases. Apparently it needs some improvement in FNM_PATHNAME case: glibc, '*/*/*' with FNM_PATHNAME: wildmatch 8s 1559us fnmatch 1s 11877us or 12.65% faster compat, '*/*/*' with FNM_PATHNAME: wildmatch 7s 922458us fnmatch 2s 905111us or 36.67% faster compat, '*/*/*' without FNM_PATHNAME: wildmatch 7s 264201us fnmatch 2s 1897us or 27.56% faster compat, '[a-z]*/[a-z]*/[a-z]*' with FNM_PATHNAME: wildmatch 8s 742827us fnmatch 0s 922943us or 10.56% faster compat, '[a-z]*/[a-z]*/[a-z]*' without FNM_PATHNAME: wildmatch 8s 284520us fnmatch 0s 6936us or 0.08% faster The rest of glibc numbers ------------------------- 'Documentation/*' wildmatch 1s 529479us fnmatch 1s 98263us or 71.81% slower 'drivers/*' wildmatch 1s 988288us fnmatch 1s 192049us or 59.95% slower 'Documentation/*' pathname wildmatch 1s 557507us fnmatch 1s 93696us or 70.22% slower 'drivers/*' pathname wildmatch 2s 161626us fnmatch 1s 230372us or 56.92% slower '[Dd]ocu[Mn]entation/*' wildmatch 1s 776581us fnmatch 1s 471693us or 82.84% slower '[Dd]o?u[Mn]en?ati?n/*' wildmatch 1s 770770us fnmatch 1s 555727us or 87.86% slower '[Dd]o?u[Mn]en?ati?n/*' pathname wildmatch 1s 783507us fnmatch 1s 537029us or 86.18% slower '[A-Za-z][A-Za-z]??*' wildmatch 4s 110386us fnmatch 4s 926306us or 119.85% slower '[A-Za-z][A-Za-z]??' wildmatch 3s 918114us fnmatch 3s 686175us or 94.08% slower '[A-Za-z][A-Za-z]??*' pathname wildmatch 4s 453746us fnmatch 4s 955856us or 111.27% slower '[A-Za-z][A-Za-z]??' pathname wildmatch 3s 896646us fnmatch 3s 733828us or 95.82% slower '*/*/*' wildmatch 7s 287985us fnmatch 1s 74083us or 14.74% slower '[a-z]*/[a-z]*/[a-z]*' pathname wildmatch 8s 796659us fnmatch 1s 568409us or 17.83% slower '[a-z]*/[a-z]*/[a-z]*' wildmatch 8s 316559us fnmatch 3s 430652us or 41.25% slower The rest of compat numbers -------------------------- 'Documentation/*' wildmatch 1s 520389us fnmatch 0s 62579us or 4.12% slower 'drivers/*' wildmatch 1s 955354us fnmatch 0s 190109us or 9.72% slower 'Documentation/*' pathname wildmatch 1s 561675us fnmatch 0s 55336us or 3.54% slower 'drivers/*' pathname wildmatch 2s 106100us fnmatch 0s 219680us or 10.43% slower '[Dd]ocu[Mn]entation/*' wildmatch 1s 750810us fnmatch 0s 542721us or 31.00% slower '[Dd]o?u[Mn]en?ati?n/*' wildmatch 1s 724791us fnmatch 0s 538948us or 31.25% slower '[Dd]o?u[Mn]en?ati?n/*' pathname wildmatch 1s 731403us fnmatch 0s 537474us or 31.04% slower '[A-Za-z][A-Za-z]??*' wildmatch 4s 28555us fnmatch 1s 67297us or 26.49% slower '[A-Za-z][A-Za-z]??' wildmatch 3s 838279us fnmatch 0s 880005us or 22.93% slower '[A-Za-z][A-Za-z]??*' pathname wildmatch 4s 379476us fnmatch 1s 55643us or 24.10% slower '[A-Za-z][A-Za-z]??' pathname wildmatch 3s 830910us fnmatch 0s 849699us or 22.18% slower The following commands are used: LANG=C ./test-wildmatch perf /tmp/filelist.txt 'Documentation/*' 2000 LANG=C ./test-wildmatch perf /tmp/filelist.txt 'drivers/*' 2000 LANG=C ./test-wildmatch perf /tmp/filelist.txt 'Documentation/*' 2000 pathname LANG=C ./test-wildmatch perf /tmp/filelist.txt 'drivers/*' 2000 pathname LANG=C ./test-wildmatch perf /tmp/filelist.txt '[Dd]ocu[Mn]entation/*' 2000 LANG=C ./test-wildmatch perf /tmp/filelist.txt '[Dd]o?u[Mn]en?ati?n/*' 2000 LANG=C ./test-wildmatch perf /tmp/filelist.txt '[Dd]o?u[Mn]en?ati?n/*' 2000 pathname LANG=C ./test-wildmatch perf /tmp/filelist.txt '[A-Za-z][A-Za-z]??*' 2000 LANG=C ./test-wildmatch perf /tmp/filelist.txt '[A-Za-z][A-Za-z]??' 2000 LANG=C ./test-wildmatch perf /tmp/filelist.txt '[A-Za-z][A-Za-z]??*' 2000 pathname LANG=C ./test-wildmatch perf /tmp/filelist.txt '[A-Za-z][A-Za-z]??' 2000 pathname LANG=C ./test-wildmatch perf /tmp/filelist.txt '*/*/*' 2000 LANG=C ./test-wildmatch perf /tmp/filelist.txt '*/*/*' 2000 pathname LANG=C ./test-wildmatch perf /tmp/filelist.txt '[a-z]*/[a-z]*/[a-z]*' 2000 pathname LANG=C ./test-wildmatch perf /tmp/filelist.txt '[a-z]*/[a-z]*/[a-z]*' 2000 Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | wildmatch: support "no FNM_PATHNAME" modeNguyễn Thái Ngọc Duy2013-01-015-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, wildmatch() has always honoured directory boundary and there was no way to turn it off. Make it behave more like fnmatch() by requiring all callers that want the FNM_PATHNAME behaviour to pass that in the equivalent flag WM_PATHNAME. Callers that do not specify WM_PATHNAME will get wildcards like ? and * in their patterns matched against '/', just like not passing FNM_PATHNAME to fnmatch(). Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | wildmatch: make dowild() take arbitrary flagsNguyễn Thái Ngọc Duy2013-01-011-7/+6
| | | | | | | | | | | | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | wildmatch: rename constants and update prototypeNguyễn Thái Ngọc Duy2013-01-014-55/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - All exported constants now have a prefix WM_ - Do not rely on FNM_* constants, use the WM_ counterparts - Remove TRUE and FALSE to follow Git's coding style - While at it, turn flags type from int to unsigned int - Add an (unused yet) argument to carry extra information so that we don't have to change the prototype again later when we need to pass other stuff to wildmatch Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jc/doc-maintainer'Junio C Hamano2013-01-251-91/+256
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Describe tools for automation that were invented since this document was originally written. * jc/doc-maintainer: howto/maintain: document "### match next" convention in jch/pu branch howto/maintain: mark titles for asciidoc Documentation: update "howto maintain git"
| * | | howto/maintain: document "### match next" convention in jch/pu branchJunio C Hamano2013-01-251-5/+6
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | howto/maintain: mark titles for asciidocJunio C Hamano2013-01-031-3/+15
| | | |
| * | | Documentation: update "howto maintain git"Junio C Hamano2013-01-031-89/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The flow described in the document is still correct, but over time I have automated various parts of the workflow with tools and their use was not explained at all. Update it and outline the use of two key scripts from the 'todo' branch, "Reintegrate" and "cook". Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'as/pre-push-hook'Junio C Hamano2013-01-2310-20/+302
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an extra hook so that "git push" that is run without making sure what is being pushed is sane can be checked and rejected (as opposed to the user deciding not pushing). * as/pre-push-hook: Add sample pre-push hook script push: Add support for pre-push hooks hooks: Add function to check if a hook exists
| * | | | Add sample pre-push hook scriptAaron Schrab2013-01-181-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a sample of a script for a pre-push hook. The main purpose is to illustrate how a script may parse the information which is supplied to such a hook. The script may also be useful to some people as-is for avoiding to push commits which are marked as a work in progress. Signed-off-by: Aaron Schrab <aaron@schrab.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | push: Add support for pre-push hooksAaron Schrab2013-01-185-0/+222
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for a pre-push hook which can be used to determine if the set of refs to be pushed is suitable for the target repository. The hook is run with two arguments specifying the name and location of the destination repository. Information about what is to be pushed is provided by sending lines of the following form to the hook's standard input: <local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LF If the hook exits with a non-zero status, the push will be aborted. This will allow the script to determine if the push is acceptable based on the target repository and branch(es), the commits which are to be pushed, and even the source branches in some cases. Signed-off-by: Aaron Schrab <aaron@schrab.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | hooks: Add function to check if a hook existsAaron Schrab2013-01-144-20/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create find_hook() function to determine if a given hook exists and is executable. If it is, the path to the script will be returned, otherwise NULL is returned. This encapsulates the tests that are used to check for the existence of a hook in one place, making it easier to modify those checks if that is found to be necessary. This also makes it simple for places that can use a hook to check if a hook exists before doing, possibly lengthy, setup work which would be pointless if no such hook is present. The returned value is left as a static value from get_pathname() rather than a duplicate because it is anticipated that the return value will either be used as a boolean, immediately added to an argv_array list which would result in it being duplicated at that point, or used to actually run the command without much intervening work. Callers which need to hold onto the returned value for a longer time are expected to duplicate the return value themselves. Signed-off-by: Aaron Schrab <aaron@schrab.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'ch/add-auto-submitted-in-sample-post-receive-email'Junio C Hamano2013-01-231-0/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * ch/add-auto-submitted-in-sample-post-receive-email: Add Auto-Submitted header to post-receive-email
| * | | | | Add Auto-Submitted header to post-receive-emailChris Hiestand2013-01-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This conforms to RFC3834 and is useful in preventing eg vacation auto-responders from replying by default Signed-off-by: Chris Hiestand <chiestand@salk.edu> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'as/check-ignore'Junio C Hamano2013-01-2320-119/+1251
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new command "git check-ignore" for debugging .gitignore files. The variable names may want to get cleaned up but that can be done in-tree. * as/check-ignore: clean.c, ls-files.c: respect encapsulation of exclude_list_groups t0008: avoid brace expansion add git-check-ignore sub-command setup.c: document get_pathspec() add.c: extract new die_if_path_beyond_symlink() for reuse add.c: extract check_path_for_gitlink() from treat_gitlinks() for reuse pathspec.c: rename newly public functions for clarity add.c: move pathspec matchers into new pathspec.c for reuse add.c: remove unused argument from validate_pathspec() dir.c: improve docs for match_pathspec() and match_pathspec_depth() dir.c: provide clear_directory() for reclaiming dir_struct memory dir.c: keep track of where patterns came from dir.c: use a single struct exclude_list per source of excludes Conflicts: builtin/ls-files.c dir.c
| * | | | | | clean.c, ls-files.c: respect encapsulation of exclude_list_groupsAdam Spiers2013-01-162-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consumers of the dir.c traversal API should avoid assuming knowledge of the internal implementation of exclude_list_groups. Therefore when adding items to an exclude list, it should be accessed via the pointer returned from add_exclude_list(), rather than by referencing a location within dir.exclude_list_groups[EXC_CMDL]. Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | t0008: avoid brace expansionRené Scharfe2013-01-101-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Brace expansion is a shell feature that's not required by POSIX and not supported by dash nor NetBSD's sh. Explicitly list all combinations instead. Also avoid calling touch by creating the test files with a redirection instead, as suggested by Junio. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | add git-check-ignore sub-commandAdam Spiers2013-01-0611-3/+905
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This works in a similar manner to git-check-attr. Thanks to Jeff King and Junio C Hamano for the idea: http://thread.gmane.org/gmane.comp.version-control.git/108671/focus=108815 Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | setup.c: document get_pathspec()Adam Spiers2013-01-061-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we have just created a new pathspec-handling library, now is a good time to add some comments explaining get_pathspec(). Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | add.c: extract new die_if_path_beyond_symlink() for reuseAdam Spiers2013-01-063-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be reused by a new git check-ignore command. Also document validate_pathspec(). Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | add.c: extract check_path_for_gitlink() from treat_gitlinks() for reuseAdam Spiers2013-01-063-18/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract the body of the for loop in treat_gitlinks() into a separate check_path_for_gitlink() function so that it can be reused elsewhere. This paves the way for a new check-ignore sub-command. Also document treat_gitlinks(). Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | pathspec.c: rename newly public functions for clarityAdam Spiers2013-01-063-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Perform the following function renames to make it explicit that these pathspec handling functions are for matching against the index, rather than against a tree or the working directory. - fill_pathspec_matches() -> add_pathspec_matches_against_index() - find_used_pathspec() -> find_pathspecs_matching_against_index() Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | add.c: move pathspec matchers into new pathspec.c for reuseAdam Spiers2013-01-064-33/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract the following functions from builtin/add.c to pathspec.c, in preparation for reuse by a new git check-ignore command: - fill_pathspec_matches() - find_used_pathspec() The functions being extracted are not changed in any way, except removal of the 'static' qualifier. Also add comments documenting these newly public functions, including clarifications that they operate on the index. Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>