aboutsummaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAge
...
* | | | | Merge branch 'maint'Junio C Hamano2007-09-17
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: git-apply: fix whitespace stripping apply --index-info: fall back to current index for mode changes core-tutorial: minor cleanup documentation: replace Discussion section by link to user-manual chapter user-manual: todo updates and cleanup user-manual: fix introduction to packfiles user-manual: move packfile and dangling object discussion user-manual: rewrite object database discussion user-manual: reorder commit, blob, tree discussion user-manual: rewrite index discussion user-manual: create new "low-level git operations" chapter user-manual: rename "git internals" to "git concepts" user-manual: move object format details to hacking-git chapter user-manual: adjust section levels in "git internals" revision walker: --cherry-pick is a limited operation git-sh-setup: typofix in comments
| * | | | apply --index-info: fall back to current index for mode changesJohannes Schindelin2007-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git diff" does not record index lines for pure mode changes (i.e. no lines changed). Therefore, apply --index-info would call out a bogus error. Instead, fall back to reading the info from the current index. Incidentally, this fixes an error where git-rebase would not rebase a commit including a pure mode change, and changes requiring a threeway merge. Noticed and later tested by Chris Shoemaker. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | revision walker: --cherry-pick is a limited operationJohannes Schindelin2007-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to rely on the fact that cherry-pick would trigger the code path to set limited = 1 in handle_commit(), when an uninteresting commit was encountered. However, when cherry picking between two independent branches, i.e. when there are no merge bases, and there is only linear development (which can happen when you cvsimport a fork of a project), no uninteresting commit will be encountered. So set limited = 1 when --cherry-pick was asked for. Noticed by Martin Bähr. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jc/partial-remove'Junio C Hamano2007-09-14
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/partial-remove: Document ls-files --with-tree=<tree-ish> git-commit: partial commit of paths only removed from the index git-commit: Allow partial commit of file removal.
| * | | | | git-commit: partial commit of paths only removed from the indexJunio C Hamano2007-09-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because a partial commit is meant to be a way to ignore what are staged in the index, "git rm --cached A && git commit A" should just record what is in A on the filesystem. The previous patch made the command sequence to barf, saying that A has not been added yet. This fixes it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | git-commit: Allow partial commit of file removal.Junio C Hamano2007-09-12
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When making a partial commit, git-commit uses git-ls-files with the --error-unmatch option to expand and sanity check the user supplied path patterns. When any path pattern does not match with the paths known to the index, it errors out, in order to catch a common mistake to say "git commit Makefiel cache.h" and end up with a commit that touches only cache.h (notice the misspelled "Makefile"). This detection however does not work well when the path has already been removed from the index. If you drop a path from the index and try to commit that partially, i.e. $ git rm COPYING $ git commit -m 'Remove COPYING' COPYING the command complains because git does not know anything about COPYING anymore. This introduces a new option --with-tree to git-ls-files and uses it in git-commit when we build a temporary index to write a tree object for the partial commit. When --with-tree=<tree-ish> option is specified, names from the given tree are added to the set of names the index knows about, so we can treat COPYING file in the example as known. Of course, there is no reason to use "git rm" and git-aware people have long time done: $ rm COPYING $ git commit -m 'Remove COPYING' COPYING which works just fine. But this caused a constant confusion. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jc/grep-c'Junio C Hamano2007-09-14
|\ \ \ \ \ | |/ / / / |/| | / / | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | * jc/grep-c: Split grep arguments in a way that does not requires to add /dev/null. Documentation/git-config.txt: AsciiDoc tweak to avoid leading dot Add test to check recent fix to "git add -u" Documentation/git-archive.txt: a couple of clarifications. Fix the rename detection limit checking diff --no-index: do not forget to run diff_setup_done()
| * | | Split grep arguments in a way that does not requires to add /dev/null.Junio C Hamano2007-09-14
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to (almost) always show the name of the file without relying on "-H" option of GNU grep, we used to add /dev/null to the argument list unless we are doing -l or -L. This caused "/dev/null:0" to show up when -c is given in the output. It is not enough to add -c to the set of options we do not pass /dev/null for. When we have too many files, we invoke grep multiple times and we need to avoid giving a widow filename to the last invocation -- otherwise we will not see the name. This keeps two filenames when the argv[] buffer is about to overflow and we have not finished iterating over the index, so that the last round will always have at least two paths to work with (and not require /dev/null). An obvious and the only exception is when there is only 1 file that is given to the underlying grep, and in that case we avoid passing /dev/null and let the external "grep -c" report only the number of matches. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Add test to check recent fix to "git add -u"Benoit Sigoure2007-09-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An earlier commit fixed type-change case in "git add -u". This adds a test to make sure we do not introduce regression. At the same time, it fixes a stupid typo in the error message. Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'maint'Junio C Hamano2007-09-12
|\ \ \ | |/ / | | / | |/ |/| | | | | | | * maint: stash: end index commit log with a newline git-commit: Disallow amend if it is going to produce an empty non-merge commit git-send-email.perl: Add angle brackets to In-Reply-To if necessary Fix a test failure (t9500-*.sh) on cygwin
| * Fix a test failure (t9500-*.sh) on cygwinRamsay Jones2007-09-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On filesystems where it is appropriate to set core.filemode to false, test 29 ("commitdiff(0): mode change") fails when git-commit does not notice a file (execute) permission change. A fix requires noting the new file execute permission in the index with a "git update-index --chmod=+x", prior to the commit. Add a function (note_chmod) which implements this idea, and insert a call in each test that modifies the x permission. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'rs/archive'Junio C Hamano2007-09-10
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | * rs/archive: archive - leakfix for format_subst() Define NO_MEMMEM on Darwin as it lacks the function archive: rename attribute specfile to export-subst archive: specfile syntax change: "$Format:%PLCHLDR$" instead of just "%PLCHLDR" (take 2) add memmem() Remove unused function convert_sha1_file() archive: specfile support (--pretty=format: in archive files) Export format_commit_message()
| * archive: rename attribute specfile to export-substRené Scharfe2007-09-06
| | | | | | | | | | | | | | | | | | | | As suggested by Junio and Johannes, change the name of the former attribute specfile to export-subst to indicate its function rather than purpose and to make clear that it is not applied to working tree files. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * archive: specfile syntax change: "$Format:%PLCHLDR$" instead of just ↵René Scharfe2007-09-06
| | | | | | | | | | | | | | | | | | | | | | | | "%PLCHLDR" (take 2) As suggested by Johannes, --pretty=format: placeholders in specfiles need to be wrapped in $Format:...$ now. This syntax change restricts the expansion of placeholders and makes it easier to use with files that contain non-placeholder percent signs. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * archive: specfile support (--pretty=format: in archive files)René Scharfe2007-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for a new attribute, specfile. Files marked as being specfiles are expanded by git-archive when they are written to an archive. It has no effect on worktree files. The same placeholders as those for the option --pretty=format: of git-log et al. can be used. The attribute is useful for creating auto-updating specfiles. It is limited by the underlying function format_commit_message(), though. E.g. currently there is no placeholder for git-describe like output, and expanded specfiles can't contain NUL bytes. That can be fixed in format_commit_message() later and will then benefit users of git-log, too. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-tag -s must fail if gpg cannot sign the tag.Carlos Rica2007-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of this patch code and message was written by Shawn O. Pearce. I made some tests to know what the problem was, and then I changed the code related with the SIGPIPE signal. If the user has misconfigured `user.signingkey` in their .git/config or just doesn't have any secret keys on their keyring and they ask for a signed tag with `git tag -s` we better make sure the resulting tag was actually signed by gpg. Prior versions of builtin git-tag allowed this failure to slip by without error as they were not checking the return value of the finish_command() so they did not notice when gpg exited with an error exit status. They also did not fail if gpg produced an empty output or if read_in_full received an error from the read system call while trying to read the pipe back from gpg. Finally, we did not actually honor any return value from the do_sign function as it returns ssize_t but was being stored into an unsigned long. This caused the compiler to optimize out the die condition, allowing git-tag to continue along and create the tag object. However, when gpg gets a wrong username, it exits before any read was done and then the writing process receives SIGPIPE and program is terminated. By ignoring this signal, anyway, the function write_or_die gets EPIPE from write_in_full and exits returning 0 to the system without a message. Here we better call to write_in_full directly so we can fail printing a message and return safely to the caller. With these issues fixed `git-tag -s` will now fail to create the tag and will report a non-zero exit status to its caller, thereby allowing automated helper scripts to detect (and recover from) failure if gpg is not working properly. Proposed-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Carlos Rica <jasampler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-diff: don't squelch the new SHA1 in submodule diffsSven Verdoolaege2007-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | The code to squelch empty diffs introduced by commit fb13227e089f22dc31a3b1624559153821056848 would inadvertently populate filespec "two" of a submodule change using the uninitialized (null) SHA1, thereby replacing the submodule SHA1 by 0{40} in the output. This change teaches diffcore_skip_stat_unmatch to handle submodule changes correctly. Signed-off-by: Sven Verdoolaege <skimo@kotnet.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Cleanup unnecessary file modifications in t1400-update-refShawn O. Pearce2007-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Kristian Høgsberg pointed out that the two file modifications we were doing during the 'creating initial files' step are not even used within the test suite. This was actually confusing as we do not even need these changes for the tests to pass. All that really matters here is the specific commit dates are used so that these appear in the branch's reflog, and that the dates are different so that the branch will update when asked and the reflog entry is also updated. There is no need for the file modification. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-apply: do not read past the end of bufferJunio C Hamano2007-09-05
|/ | | | | | | | | | | | | | | | When the preimage we are patching is shorter than what the patch text expects, we tried to match the buffer contents at the "original" line with the fragment in full, without checking we have enough data to match in the preimage. This caused the size of a later memmove() to wrap around and attempt to scribble almost the entire address space. Not good. The code that follows the part this patch touches tries to match the fragment with line offsets. Curiously, that code does not have the problem --- it guards against reading past the end of the preimage. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase -m: Fix incorrect short-logs of already applied commits.Johannes Sixt2007-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | When a topic branch is rebased, some of whose commits are already cherry-picked upstream: o--X--A--B--Y <- master \ A--B--Z <- topic then 'git rebase -m master' would report: Already applied: 0001 Y Already applied: 0002 Y With this fix it reports the expected: Already applied: 0001 A Already applied: 0002 B As an added bonus, this change also avoids 'echo' of a commit message, which might contain escapements. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-tag: Fix -l option to use better shell style globs.Carlos Rica2007-08-31
| | | | | | | | | | | | | | | | | | | | | | | | This patch removes certain behaviour of "git tag -l foo", currently listing every tag name having "foo" as a substring. The same thing now could be achieved doing "git tag -l '*foo*'". This feature was added recently when git-tag.sh got the -n option for showing tag annotations, because that commit also replaced the old "grep pattern" behaviour with a more preferable "shell pattern" behaviour (although slightly modified as you can see). Thus, the following builtin-tag.c implemented it in order to ensure that tests were passing unchanged with both programs. Since common "shell patterns" match names with a given substring _only_ when * is inserted before and after (as in "*substring*"), and the "plain" behaviour cannot be achieved easily with the current implementation, this is mostly the right thing to do, in order to make it more flexible and consistent. Tests for "git tag" were also changed to reflect this. Signed-off-by: Carlos Rica <jasampler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn: fix dcommit clobbering upstream when committing multiple changesEric Wong2007-08-31
| | | | | | | | | | | | | | | | | | | | | Although dcommit could detect if the first commit in the series would conflict with the HEAD revision in SVN, it could not detect conflicts in further commits it made. Now we rebase each uncommitted change after each revision is committed to SVN to ensure that we are up-to-date. git-rebase will bail out on conflict errors if our next change cannot be applied and committed to SVN cleanly, preventing accidental clobbering of changes on the SVN-side. --no-rebase users will have trouble with this, and are thus warned if they are committing more than one commit. Fixing this for (hopefully uncommon) --no-rebase users would be more complex and will probably happen at a later date. Thanks to David Watson for finding this and the original test. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* filter-branch: introduce convenience function "skip_commit"Johannes Schindelin2007-08-31
| | | | | | | | | | | | | | | | | | | | | | With this function, a commit filter can leave out unwanted commits (such as temporary commits). It does _not_ undo the changeset corresponding to that commit, but it _skips_ the revision. IOW no tree object is changed by this. If you like to commit early and often, but want to filter out all intermediate commits, marked by "@@@" in the commit message, you can now do this with git filter-branch --commit-filter ' if git cat-file commit $GIT_COMMIT | grep '@@@' > /dev/null; then skip_commit "$@"; else git commit-tree "$@"; fi' newbranch Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* filter-branch: provide the convenience functions also for commit filtersJohannes Schindelin2007-08-31
| | | | | | | | | | | | Move the convenience functions to the top of git-filter-branch.sh, and return from the script when the environment variable SOURCE_FUNCTIONS is set. By sourcing git-filter-branch with that variable set automatically, all commit filters may access the convenience functions like "map". Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-merge: do up-to-date check also for all strategiesJunio C Hamano2007-08-27
| | | | | | | | | | | | | | | | | | | | | | | This clarifies the logic to omit fast-forward check and omit trivial merge before running the specified strategy. The "index_merge" variable started out as a flag to say "do not do anything clever", but when recursive was changed to skip the trivial merge, the semantics were changed and the variable alone does not make sense anymore. This splits the variable into two, allow_fast_forward (which is almost always true, and avoids making a merge commit when the other commit is a descendant of our branch, but is set to false for ours and subtree) and allow_trivial_merge (which is false for ours, recursive and subtree). Unlike the earlier implementation, the "ours" strategy allows an up-to-date condition. When we are up-to-date, the result will be our commit, and by definition, we will have our tree as the result. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix initialization of a bare repositoryJunio C Hamano2007-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here is my attempt to fix this with a minimally intrusive patch. * As "git --bare init" cannot tell if it was called with --bare or just "GIT_DIR=. git init", I added an explicit assignment of is_bare_repository_cfg on the codepath for "git --bare". * GIT_WORK_TREE alone without GIT_DIR does not make any sense, nor GIT_WORK_TREE with an explicit "git --bare". Catch that mistake. It might make sense to move this check to "git.c" side as well, but I tried to shoot for the minimum change for now. * Some scripts, especially from the olden days, rely on traditional GIT_DIR behaviour in "git init". Namely, these are some notable patterns: (create a bare repository) - mkdir some.git && cd some.git && GIT_DIR=. git init - mkdir some.git && cd some.git && git --bare init (create a non-bare repository) - mkdir .git && GIT_DIR=.git git init - mkdir .git && GIT_DIR=`pwd`/.git git init This comes with a new test script and also passes the existing test suite, but there may be cases that are still broken with the current tip of master and this patch does not yet fix. I'd appreciate help in straightening this mess out. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix racy-git handling in git-write-tree.Linus Torvalds2007-08-24
| | | | | | | | | | | | | | | | | | | | | | After git-write-tree finishes computing the tree, it updates the index so that later operations can take advantage of fully populated cache tree. However, anybody writing the index file has to mark the entries that are racily clean. For each entry whose cached lstat(3) data in the index exactly matches what is obtained from the filesystem, if the timestamp on the index file was the same or older than the modification timestamp of the file, the blob contents and the work tree file, after convert_to_git(), need to be compared, and if they are different, its index entry needs to be marked not to match the lstat(3) data from the filesystem. In order for this to work, convert_to_git() needs to work correctly, which in turn means you need to read the config file to get the settings of core.crlf and friends. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase -i: fix squashing corner caseJohannes Schindelin2007-08-23
| | | | | | | | | | | | When squashing, rebase -i did not prevent fast forwards. This could happen when picking some other commit than the first one, and then squashing the first commit. So do not allow fast forwards when squashing. Noticed by Johannes Sixt. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Make thin-pack generation subproject aware.Linus Torvalds2007-08-19
| | | | | | | | | | | | When a thin pack wants to send a tree object at "sub/dir", and the commit that is common between the sender and the receiver that is used as the base object has a subproject at that path, we should not try to use the data at "sub/dir" of the base tree as a tree object. It is not a tree to begin with, and more importantly, the commit object there does not have to even exist. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Allow frontends to bidirectionally communicate with fast-importShawn O. Pearce2007-08-19
| | | | | | | | | | | | | | | The existing checkpoint command is very useful to force fast-import to dump the branches out to disk so that standard Git tools can access them and the objects they refer to. However there was not a way to know when fast-import had finished executing the checkpoint and it was safe to read those refs. The progress command can be used to make fast-import output any message of the frontend's choosing to standard out. The frontend can scan for these messages using select() or poll() to monitor a pipe connected to the standard output of fast-import. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Make trailing LF optional for all fast-import commandsShawn O. Pearce2007-08-19
| | | | | | | | | | | | | | | | | | For the same reasons as the prior change we want to allow frontends to omit the trailing LF that usually delimits commands. In some cases these just make the input stream more verbose looking than it needs to be, and its just simpler for the frontend developer to get started if our parser is slightly more lenient about where an LF is required and where it isn't. To make this optional LF feature work we now have to buffer up to one line of input in command_buf. This buffering can happen if we look at the current input command but don't recognize it at this point in the code. In such a case we need to "unget" the entire line, but we cannot depend upon the stdio library to let us do ungetc() for that many characters at once. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Make trailing LF following fast-import `data` commands optionalShawn O. Pearce2007-08-19
| | | | | | | | | | | | A few fast-import frontend developers have found it odd that we require the LF following a `data` command, especially in the exact byte count format. Technically we don't need this LF to parse the stream properly, but having it here does make the stream more readable to humans. We can easily make the LF optional by peeking at the next byte available from the stream and pushing it back into the buffer if its not LF. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Teach fast-import to ignore lines starting with '#'Shawn O. Pearce2007-08-19
| | | | | | | | | | | | | | | | | | | | | | Several frontend developers have asked that some form of stream comments be permitted within a fast-import data stream. This way they can include information from their own frontend program about where specific data was taken from in the source system, or about a decision that their frontend may have made while creating the fast-import data stream. This change introduces comments in the Bourne-shell/Tcl/Perl style. Lines starting with '#' are ignored, up to and including the LF. Unlike the above mentioned three languages however we do not look for and ignore leading whitespace. This just simplifies the definition of the comment format and the code that parses them. To make comments work we had to stop using read_next_command() within cmd_data() and directly invoke read_line() during the inline variant of the function. This is necessary to retain any lines of the input data that might otherwise look like a comment to fast-import. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Actually allow TAG_FIXUP branches in fast-importShawn O. Pearce2007-08-19
| | | | | | | | | | | | | | | | | | | Michael Haggerty <mhagger@alum.mit.edu> noticed while debugging a Git backend for cvs2svn that fast-import was barfing when he tried to use "TAG_FIXUP" as a branch name for temporary work needed to cleanup the tree prior to creating an annotated tag object. The reason we were rejecting the branch name was check_ref_format() returns -2 when there are less than 2 '/' characters in the input name. TAG_FIXUP has 0 '/' characters, but is technically just as valid of a ref as HEAD and MERGE_HEAD, so we really should permit it (and any other similar looking name) during import. New test cases have been added to make sure we still detect very wrong branch names (e.g. containing [ or starting with .) and yet still permit reasonable names (e.g. TAG_FIXUP). Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* t1301-shared-repo.sh: fix 'stat' portability issueArjen Laarhoven2007-08-16
| | | | | | | | | The t1301-shared-repo.sh testscript uses /usr/bin/stat to get the file mode, which isn't portable. Implement the test in shell using 'ls' as shown by Junio. Signed-off-by: Arjen Laarhoven <arjen@yaph.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-clone: allow --bare cloneJunio C Hamano2007-08-15
| | | | | | | This is a stop-gap to work around problem with git-init without intrusive changes. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-apply: apply submodule changesSven Verdoolaege2007-08-15
| | | | | | | | | | | | | Apply "Subproject commit HEX" changes produced by git-diff. As usual in the current git, only the superproject itself is actually modified (possibly creating empty directories for new submodules). Any checked-out submodule is left untouched and is not required to be up-to-date. With clean-ups from Junio C Hamano. Signed-off-by: Sven Verdoolaege <skimo@kotnet.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint' to sync with 1.5.2.5Junio C Hamano2007-08-15
|\ | | | | | | | | | | | | * maint: GIT 1.5.2.5 git-add -u paths... now works from subdirectory Fix "git add -u" data corruption.
| * git-add -u paths... now works from subdirectorySalikh Zakirov2007-08-15
| | | | | | | | | | | | | | | | | | | | git-add -u also takes the path limiters, but unlike the command without the -u option, the code forgot that it could be invoked from a subdirectory, and did not correctly handle the prefix. Signed-off-by: Salikh Zakirov <salikh@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Fix "git add -u" data corruption.Junio C Hamano2007-08-15
| | | | | | | | | | | | | | | | | | | | | | | | This applies to 'maint' to fix a rather serious data corruption issue. When "git add -u" affects a subdirectory in such a way that the only changes to its contents are path removals, the next tree object written out of that index was bogus, as the remove codepath forgot to invalidate the cache-tree entry. Reported by Salikh Zakirov. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-svn: fix log with single revision against a non-HEAD branchEric Wong2007-08-15
| | | | | | | | | | | | | | | | | | Running git-svn log <ref> -r<rev> against a <ref> other than the current HEAD did not work if the <rev> was exclusive to the other branch. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | attr.c: read .gitattributes from index as well.Junio C Hamano2007-08-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes .gitattributes files to be read from the index when they are not checked out to the work tree. This is in line with the way we always allowed low-level tools to operate in sparsely checked out work tree in a reasonable way. It swaps the order of new file creation and converting the blob to work tree representation; otherwise when we are in the middle of checking out .gitattributes we would notice an empty but unwritten .gitattributes file in the work tree and will ignore the copy in the index. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | merge-recursive: do not rudely die on binary mergeJunio C Hamano2007-08-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you try to merge a path that involves binary file-level merge, merge-recursive died rudely without cleaning up its own mess. A files added by the merge were left in the working tree, but the index was not written out (because it just punted and died), so it was cumbersome for the user to retry it by first running "git reset --hard". This changes merge-recursive to still warn but do the "binary" merge for such a path; leave the "our" version in the working tree, but still keep the path unmerged so that the user can sort it out. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Add a test for git-commit being confused by relative GIT_DIRDavid Kastrup2007-08-13
| | | | | | | | | | Signed-off-by: David Kastrup <dak@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Fix t5701-clone-local for white space from wcBrian Gernhardt2007-08-13
| | | | | | | | | | Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t3902 - skip test if file system doesn't support HT in namesMark Levedahl2007-08-13
| | | | | | | | | | | | | | | | Windows / cygwin don't support HT, LF, or TAB in file name so this test is meaningless there. Signed-off-by: Mark Levedahl <mdl123@verizon.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-add: Add support for --refresh option.Alexandre Julliard2007-08-13
| | | | | | | | | | | | | | | | This allows to refresh only a subset of the project files, based on the specified pathspecs. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t3404: fix "fake-editor"Junio C Hamano2007-08-13
| | | | | | | | | | | | | | | | | | | | | | | | Here-text to create fake-editor did not use <<\EOF but <<EOF, but there was no point doing so, as it quoted all the variables anyway. Simplify it. Also futureproof the special mode to edit COMMIT_EDITMSG file; it is interested in editing the COMMIT_EDITMSG file in any GIT_DIR; GIT_DIR may be given as an absolute path. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'cr/tag'Junio C Hamano2007-08-10
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | * cr/tag: Teach "git stripspace" the --strip-comments option Make verify-tag a builtin. builtin-tag.c: Fix two memory leaks and minor notation changes. launch_editor(): Heed GIT_EDITOR and core.editor settings Make git tag a builtin.
| * | Teach "git stripspace" the --strip-comments optionJohannes Schindelin2007-07-26
| | | | | | | | | | | | | | | | | | | | | | | | With --strip-comments (or short -s), git stripspace now removes lines beginning with a '#', too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>