summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Use git_pathdup instead of xstrdup(git_path(...))Alex Riesen2008-10-309-12/+12
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git_pathdup: returns xstrdup-ed copy of the formatted pathAlex Riesen2008-10-302-4/+22
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix potentially dangerous use of git_path in ref.cAlex Riesen2008-10-301-3/+5
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add git_snpath: a .git path formatting routine with output bufferAlex Riesen2008-10-302-0/+25
| | | | | | | | The function's purpose is to replace git_path where the buffer of formatted path may not be reused by subsequent calls of the function or will be copied anyway. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix potentially dangerous uses of mkpath and git_pathAlex Riesen2008-10-261-2/+2
| | | | | | | | Replace them with mksnpath/git_snpath and a local buffer for the resulting string. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.cAlex Riesen2008-10-261-2/+4
| | | | | | | | | | | | | Otherwise the function sometimes fail to resolve obviously correct refnames, because the string data pointed to by "str" argument were reused. The change in dwim_log does not fix anything, just optimizes away strcpy code as the path can be created directly in the available buffer. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add mksnpath which allows you to specify the output bufferAlex Riesen2008-10-262-0/+18
| | | | | | | | | | This is just vsnprintf's but additionally calls cleanup_path() on the result. To be used as alternatives to mkpath() where the buffer for the created path may not be reused by subsequent calls of the same formatting function. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* add -p: warn if only binary changes presentThomas Rast2008-10-261-2/+7
| | | | | | | | | | Current 'git add -p' will say "No changes." if there are no changes to text files, which can be confusing if there _are_ changes to binary files. Add some code to distinguish the two cases, and give a different message in the latter one. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-archive: work in bare reposCharles Bailey2008-10-263-2/+23
| | | | | | | | | | | | This moves the call to git_config to a place where it doesn't break the logic for using git archive in a bare repository but retains the fix to make git archive respect core.autocrlf. Tests are by René Scharfe. Signed-off-by: Charles Bailey <charles@hashpling.org> Tested-by: Deskin Miller <deskinm@umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn: change dashed git-config to git configDeskin Miller2008-10-241-1/+1
| | | | | | Signed-off-by: Deskin Miller <deskinm@umich.edu> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* GIT 1.6.0.3v1.6.0.3Junio C Hamano2008-10-211-9/+6
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rehabilitate 'git index-pack' inside the object storeNicolas Pitre2008-10-212-3/+29
| | | | | | | | Before commit d0b92a3f6e it was possible to run 'git index-pack' directly in the .git/objects/pack/ directory. Restore that ability. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix testcase failure when extended attributes are in useJunio C Hamano2008-10-191-4/+6
| | | | | | | | | | | | | | | | 06cbe855 (Make core.sharedRepository more generic, 2008-04-16) made several testcases in t1301-shared-repo.sh which fail if on a system which creates files with extended attributes (e.g. SELinux), since ls appends a '+' sign to the permission set in such cases. In fact, POSIX.1 allows ls to add a single printable character after the usual 3x3 permission bits to show that an optional alternate/additional access method is associated with the path. This fixes the testcase to strip any such sign prior to verifying the permission set. Signed-off-by: Junio C Hamano <gitster@pobox.com> Tested-by: Deskin Miller <deskinm@umich.edu>
* Documentation: Clarify '--signoff' for git-commitAbhijit Bhopatkar2008-10-181-1/+2
| | | | | | | | '--signoff' uses commiter name always to add the signoff line, make it explicit in the documentation. Signed-off-by: Abhijit Bhopatkar <bain@devslashzero.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Hopefully the final draft release notes update before 1.6.0.3Junio C Hamano2008-10-181-1/+9
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* diff(1): clarify what "T"ypechange status meansJunio C Hamano2008-10-181-1/+2
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'db/maint-checkout-b' into maintJunio C Hamano2008-10-182-0/+22
|\ | | | | | | | | * db/maint-checkout-b: Check early that a new branch is new and valid
| * Check early that a new branch is new and validDaniel Barkalow2008-09-212-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you fail to update refs to change branches in checkout, your index and working tree are left already updated. We don't have an easy way to undo this, but at least we can check things that would make the creation of a new branch fail. These checks were in the shell version, and were lost in the C conversion. The messages are from the shell version, and should probably be made nicer. [jc: added test to t7201] Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | contrib: update packinfo.pl to not use dashed commandsDan McGee2008-10-181-7/+7
| | | | | | | | | | Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | force_object_loose: Fix memory leakBjörn Steinbrink2008-10-181-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | read_packed_sha1 expectes its caller to free the buffer it returns, which force_object_loose didn't do. This leak is eventually triggered by "git gc", when it is manually invoked or there are too many packs around, making gc totally unusable when there are lots of unreachable objects. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | tests: shell negation portability fixJeff King2008-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 969c8775 introduced a test which uses the non-portable construct: command1 && ! command2 | command3 which must be command1 && ! (command2 | command3) to work on bsd shells (this is another example of bbf08124, which fixed several similar cases). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t1301-shared-repo.sh: don't let a default ACL interfere with the testMatt McCutchen2008-10-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | This test creates files with several different umasks and expects their permissions to be initialized according to the umask, so a default ACL on the trash directory (which overrides the umask for files created in that directory) causes the test to fail. To avoid that, remove the default ACL if possible with setfacl(1). Signed-off-by: Matt McCutchen <matt@mattmccutchen.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-check-attr(1): add output and example sectionsJonas Fonseca2008-10-161-0/+50
| | | | | | | | | | | | | | Plumbing tools should document what output can be expected. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | xdiff-interface.c: strip newline (and cr) from line before pattern matchingBrandon Casey2008-10-162-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX doth sayeth: "In the regular expression processing described in IEEE Std 1003.1-2001, the <newline> is regarded as an ordinary character and both a period and a non-matching list can match one. ... Those utilities (like grep) that do not allow <newline>s to match are responsible for eliminating any <newline> from strings before matching against the RE." Thus far git has not been removing the trailing newline from strings matched against regular expression patterns. This has the effect that (quoting Jonathan del Strother) "... a line containing just 'FUNCNAME' (terminated by a newline) will be matched by the pattern '^(FUNCNAME.$)' but not '^(FUNCNAME$)'", and more simply not '^FUNCNAME$'. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | t4018-diff-funcname: demonstrate end of line funcname matching flawBrandon Casey2008-10-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | Since the newline is not removed from lines before pattern matching, a pattern cannot match to the end of the line using the '$' operator without using an additional operator which will indirectly match the '\n' character. Introduce a test which should pass, but which does not due to this flaw. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t4018-diff-funcname: rework negated last expression testBrandon Casey2008-10-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test used the non-zero exit status of 'git diff' to indicate that a negated funcname pattern, when placed last, was correctly rejected. The problem with this is that 'git diff' always returns non-zero if it finds differences in the files it is comparing, and the files must contain differences in order to trigger the funcname pattern codepath. Instead of checking for non-zero exit status, make sure the expected error message is printed. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Typo "does not exists" when git remote update remote.Mikael Magnusson2008-10-161-1/+1
| |
* | remote.c: correct the check for a leading '/' in a remote nameBrandon Casey2008-10-141-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test is supposed to disallow remote entries in the config file of the form: [remote "/foobar"] ... The leading slash in '/foobar' is not acceptable. Instead it was incorrectly testing that the subkey had no leading '/', which had no effect since the subkey pointer was made to point at a '.' in the preceding lines. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Acked-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Add testcase to ensure merging an early part of a branch is done properlyMiklos Vajna2008-10-141-0/+26
| | | | | | | | | | Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Update draft release notes to 1.6.0.3Junio C Hamano2008-10-131-2/+19
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | test-lib: fix broken printfShawn O. Pearce2008-10-121-1/+1
| | | | | | | | | | | | | | b8eecafd888d219633f4c29e8b6a90fc21a46dfd introduced usage of printf without a format string. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | git apply --directory broken for new filesJeff King2008-10-122-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We carefully verify that the input to git-apply is sane, including cross-checking that the filenames we see in "+++" headers match what was provided on the command line of "diff --git". When --directory is used, however, we ended up comparing the unadorned name to one with the prepended root, causing us to complain about a mismatch. We simply need to prepend the root directory, if any, when pulling the name out of the git header. Signed-off-by: Jeff King <peff@peff.net> Acked-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | rebase -i: do not fail when there is no commit to cherry-pickJohannes Schindelin2008-10-102-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | In case there is no commit to apply (for example because you rebase to upstream and all your local patches have been applied there), do not fail. The non-interactive rebase already behaves that way. Do this by introducing a new command, "noop", which is substituted for an empty commit list, so that deleting the commit list can still abort as before. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | test-lib: fix color reset in say_color()Miklos Vajna2008-10-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | When executing a single test with colors enabled, the cursor was not set back to the previous one, and you had to hit an extra enter to get it back. Work around this problem by calling 'tput sgr0' before printing the final newline. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | fix pread()'s short read in index-packNicolas Pitre2008-10-103-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since v1.6.0.2~13^2~ the completion of a thin pack uses sha1write() for its ability to compute a SHA1 on the written data. This also provides data buffering which, along with commit 92392b4a45, will confuse pread() whenever an appended object is 1) freed due to memory pressure because of the depth-first delta processing, and 2) needed again because it has many delta children, and 3) its data is still buffered by sha1write(). Let's fix the issue by simply forcing cached data out when such an object is written so it can be pread()'d at leisure. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Merge branch 'sg/maint-intrebase-msghook' into maintShawn O. Pearce2008-10-091-6/+11
|\ \ | | | | | | | | | | | | | | | * sg/maint-intrebase-msghook: rebase -i: remove leftover debugging rebase -i: proper prepare-commit-msg hook argument when squashing
| * | rebase -i: remove leftover debuggingSZEDER Gábor2008-10-031-1/+1
| | | | | | | | | | | | | | | Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | rebase -i: proper prepare-commit-msg hook argument when squashingSZEDER Gábor2008-10-021-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One would expect that the prepare-commit-msg hook gets 'squash' as the second argument when squashing commits with 'rebase -i'. However, that was not the case, as it got 'merge' instead. This patch fixes the problem. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | builtin-apply: fix typo leading to stack corruptionImre Deak2008-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This typo led to stack corruption for lines with whitespace fixes and length > 1024. Signed-off-by: Imre Deak <imre.deak@gmail.com> Looks-good-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | git-stash.sh: fix flawed fix of invalid ref handling (commit da65e7c1)Brandon Casey2008-10-091-18/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The referenced commit tried to fix a flaw in stash's handling of a user supplied invalid ref. i.e. 'git stash apply fake_ref@{0}' should fail instead of applying stash@{0}. But, it did so in a naive way by avoiding the use of the --default option of rev-parse, and instead manually supplied the default revision if the user supplied an empty command line. This prevented a common usage scenario of supplying flags on the stash command line (i.e. non-empty command line) which would be parsed by lower level git commands, without supplying a specific revision. This should fall back to the default revision, but now it causes an error. e.g. 'git stash show -p' The correct fix is to use the --verify option of rev-parse, which fails properly if an invalid ref is supplied, and still allows falling back to a default ref when one is not supplied. Convert stash-drop to use --verify while we're at it, since specifying multiple revisions for any of these commands is also an error and --verify makes it so. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Merge branch 'jk/maint-soliconv' into maintShawn O. Pearce2008-10-091-1/+0
|\ \ \ | | | | | | | | | | | | | | | | * jk/maint-soliconv: Makefile: do not set NEEDS_LIBICONV for Solaris 8
| * | | Makefile: do not set NEEDS_LIBICONV for Solaris 8Jeff King2008-10-031-1/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This breaks my build on Solaris 8, as there is no separate libiconv. The history of this line is somewhat convoluted. In 2fd955c (in November 2005), NEEDS_LIBICONV was turned on for all Solaris builds, claiming to "fix an error in Solaris 10 by setting NEEDS_LIBICONV". Later, e15f545 (in February of 2006) claimed that "Solaris 9+ don't need iconv", and moved NEEDS_LIBICONV into a section for Solaris 8. Furthermore, Brandon Casey claims in <5A1KxlhmUIHe8iXPxnXYuNXsq0Yjlbwkz2eBin3z7ELuL9nK-4tSpw@cipher.nrlssc.navy.mil> that he does not set NEEDS_LIBICONV for Solaris 7. So either one of those commits is totally wrong, or there is some other magic going on where some Solaris installs need it and others don't. Given Brandon's statement and my problems on Solaris 8 with NEEDS_LIBICONV, I am inclined to think the first commit was bogus, and that NEEDS_LIBICONV shouldn't be set for Solaris at all by default. If somebody wants to use iconv and has installed it manually, they can set it in their config.mak. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | builtin-merge.c: allocate correct amount of memoryBrandon Casey2008-10-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix two memory allocation errors which allocate space for a pointer rather than enough space for the structure itself. This: struct commit_list *parent = xmalloc(sizeof(struct commit_list *)); should have been this: struct commit_list *parent = xmalloc(sizeof(struct commit_list)); But while we're at it, change the allocation to reference the variable it is allocating memory for to try to prevent a similar mistake, for example if the type is changed, in the future. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Acked-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Do not use errno when pread() returns 0Samuel Tardieu2008-10-081-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | If we use pread() while at the end of the file, it will return 0, which is not an error from the operating system point of view. In this case, errno has not been set and must not be used. Signed-off-by: Samuel Tardieu <sam@rfc1149.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | git init: --bare/--shared overrides system/global configDeskin Miller2008-10-082-2/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If core.bare or core.sharedRepository are set in /etc/gitconfig or ~/.gitconfig, then 'git init' will read the values when constructing a new config file; reading them, however, will override the values specified on the command line. In the case of --bare, this ends up causing a segfault, without the repository being properly initialised; in the case of --shared, the permissions are set according to the existing config settings, not what was specified on the command line. This fix saves any specified values for --bare and --shared prior to reading existing config settings, and restores them after reading but before writing the new config file. core.bare is ignored in all situations, while core.sharedRepository will only be used if --shared is not specified to git init. Also includes testcases which use a specified global config file override, demonstrating the former failure scenario. Signed-off-by: Deskin Miller <deskinm@umich.edu> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | git-push.txt: Describe --repo option in more detailJohannes Sixt2008-10-082-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The --repo option was described in a way that the reader would have to assume that it is the same as the <repository> parameter. But it actually servers a purpose, which is now written down. Furthermore, the --mirror option was missing from the synopsis. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | git rm: refresh index before up-to-date checkJohannes Schindelin2008-10-082-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | Since "git rm" is supposed to be porcelain, we should convince it to be user friendly by refreshing the index itself. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Fix a few typos in relnotesMikael Magnusson2008-10-071-4/+4
| | | | | | | | | | | | Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Update release notes for 1.6.0.3Shawn O. Pearce2008-10-061-1/+51
| | | | | | | | | | | | Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Teach rebase -i to honor pre-rebase hookNanako Shiraishi2008-10-063-7/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | The original git-rebase honored pre-rebase hook so that public branches can be protected from getting rebased, but rebase --interactive ignored the hook entirely. This fixes it. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>