summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)Author
2007-10-16Merge branch 'maint'Shawn O. Pearce
* maint: Whip post 1.5.3.4 maintenance series into shape. rebase -i: use diff plumbing instead of porcelain Do not remove distributed configure script git-archive: document --exec git-reflog: document --verbose git-config: handle --file option with relative pathname properly clear_commit_marks(): avoid deep recursion git add -i: Remove unused variables git add -i: Fix parsing of abbreviated hunk headers git-config: don't silently ignore options after --list Clean up "git log" format with DIFF_FORMAT_NO_OUTPUT Fix embarrassing "git log --follow" bug Conflicts: RelNotes git-rebase--interactive.sh
2007-10-16Add a --dry-run option to git-push.Brian Ewins
The default behaviour of git-push is potentially confusing for new users, since it will push changes that are not on the current branch. Publishing patches that were still cooking on a development branch is hard to undo. It would also be nice to be able to verify the expansion of refspecs if you've edited them, so that you know what branches matched on the server. Adding a --dry-run flag allows the user to experiment safely and learn how to use git-push properly. Originally suggested by Steffen Prohaska. Signed-off-by: Brian Ewins <brian.ewins@gmail.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16Added a test for fetching remote tags when there is not tags.Väinö Järvelä
When a user runs "git fetch -t", git crashes when it doesn't find any tags on the remote repository. Signed-off-by: Väinö Järvelä <v@pp.inet.fi> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16fix t5403-post-checkout-hook.sh: built-in test in dash does not have "=="Alex Riesen
Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-16Clean up "git log" format with DIFF_FORMAT_NO_OUTPUTLinus Torvalds
This fixes an unnecessary empty line that we add to the log message when we generate diffs, but don't actually end up printing any due to having DIFF_FORMAT_NO_OUTPUT set. This can happen with pickaxe or with rename following. The reason is that we normally add an empty line between the commit and the diff, but we do that even for the case where we've then suppressed the actual printing of the diff. This also updates a couple of tests that assumed the extraneous empty line would exist at the end of output. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-03Merge branch 'mv/unknown'Junio C Hamano
* mv/unknown: Don't use "<unknown>" for placeholders and suppress printing of empty user formats.
2007-10-03Merge branch 'ph/strbuf'Junio C Hamano
* ph/strbuf: (44 commits) Make read_patch_file work on a strbuf. strbuf_read_file enhancement, and use it. strbuf change: be sure ->buf is never ever NULL. double free in builtin-update-index.c Clean up stripspace a bit, use strbuf even more. Add strbuf_read_file(). rerere: Fix use of an empty strbuf.buf Small cache_tree_write refactor. Make builtin-rerere use of strbuf nicer and more efficient. Add strbuf_cmp. strbuf_setlen(): do not barf on setting length of an empty buffer to 0 sq_quote_argv and add_to_string rework with strbuf's. Full rework of quote_c_style and write_name_quoted. Rework unquote_c_style to work on a strbuf. strbuf API additions and enhancements. nfv?asprintf are broken without va_copy, workaround them. Fix the expansion pattern of the pseudo-static path buffer. builtin-for-each-ref.c::copy_name() - do not overstep the buffer. builtin-apply.c: fix a tiny leak introduced during xmemdupz() conversion. Use xmemdupz() in many places. ...
2007-10-03Merge branch 'lh/merge'Junio C Hamano
* lh/merge: git-merge: add --ff and --no-ff options git-merge: add support for --commit and --no-squash git-merge: add support for branch.<name>.mergeoptions git-merge: refactor option parsing git-merge: fix faulty SQUASH_MSG Add test-script for git-merge porcelain
2007-10-03Merge branch 'js/rebase-i'Junio C Hamano
* js/rebase-i: rebase -i: work on a detached HEAD
2007-10-03Merge branch 'je/hooks'Junio C Hamano
* je/hooks: post-checkout hook, tests, and docs
2007-10-03Merge branch 'ap/dateformat'Junio C Hamano
* ap/dateformat: Add a test script for for-each-ref, including test of date formatting dateformat: parse %(xxdate) %(yydate:format) correctly Make for-each-ref's grab_date() support per-atom formatting Make for-each-ref allow atom names like "<name>:<something>" parse_date_format(): convert a format name to an enum date_mode
2007-10-03Sync with GIT 1.5.3.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-03Add a test script for for-each-ref, including test of date formattingAndy Parkins
Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-03Add test case for ls-files --with-treeCarl Worth
This tests basic functionality and also exercises a bug noticed by Keith Packard, (prune_cache followed by add_index_entry can trigger an attempt to realloc a pointer into the middle of an allocated buffer). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-01fetch/push: readd rsync supportJohannes Schindelin
We lost rsync support when transitioning from shell to C. Support it again (even if the transport is technically deprecated, some people just do not have any chance to use anything else). Also, add a test to t5510. Since rsync transport is not configured by default on most machines, and especially not such that you can write to rsync://127.0.0.1$(pwd)/, it is disabled by default; you can enable it by setting the environment variable TEST_RSYNC. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-30Merge branch 'maint'Junio C Hamano
* maint: git-remote: exit with non-zero status after detecting errors. rebase -i: squash should retain the authorship of the _first_ commit git-add--interactive: Improve behavior on bogus input git-add--interactive: Allow Ctrl-D to exit
2007-09-30rebase -i: squash should retain the authorship of the _first_ commitJohannes Schindelin
It was determined on the mailing list, that it makes more sense for a "squash" to keep the author of the first commit as the author for the result of the squash. Make it so. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-30post-checkout hook, tests, and docsJosh England
Updated post-checkout hook to take a flag specifying whether the checkout is a branch checkout or a file checkout (from the index). Signed-off-by: Josh England <jjengla@sandia.gov> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29Merge branch 'sv/svn'Junio C Hamano
* sv/svn: git-svn: handle changed svn command-line syntax git-svn: fix test for trunk svn (transaction out of date) git-svn: fix test for trunk svn (commit message not needed)
2007-09-29Merge branch 'jb/remote-rm'Junio C Hamano
* jb/remote-rm: git-remote rm: add tests and minor fix-ups remote: document the 'rm' subcommand remote: add 'rm' subcommand
2007-09-26rebase -i: work on a detached HEADJohannes Schindelin
Earlier, rebase -i refused to rebase a detached HEAD. Now it no longer does. Incidentally, this fixes "git gc --auto" shadowing the true exit status. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26Don't use "<unknown>" for placeholders and suppress printing of empty user ↵Michal Vitecek
formats. This changes the interporate() to replace entries with NULL values by the empty string, and uses it to interpolate missing fields in custom format output used in git-log and friends. It is most useful to avoid <unknown> output from %b format for a commit log message that lack any body text. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26rebase -i: commit when continuing after "edit"Johannes Schindelin
When doing an "edit" on a commit, editing and git-adding some files, "git rebase -i" complained about a missing "author-script". The idea was that the user would call "git commit --amend" herself. But we can be nice and do that for the user. Noticed by Dmitry Potapov. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25Merge branch 'maint'Junio C Hamano
* maint: Do not over-quote the -f envelopesender value. unexpected Make output (e.g. from --debug) causes build failure Fixed minor typo in t/t9001-send-email.sh test command line.
2007-09-25Fixed minor typo in t/t9001-send-email.sh test command line.Glenn Rempe
The git-send-email command line in the test was missing a single hyphen. Signed-off-by: Glenn Rempe <glenn@rempe.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-24git-remote rm: add tests and minor fix-upsJunio C Hamano
This fixes "git remote rm" which always exited with a failure, corrects indentation, and adds tests. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-24git-merge: add --ff and --no-ff optionsLars Hjemli
These new options can be used to control the policy for fast-forward merges: --ff allows it (this is the default) while --no-ff will create a merge commit. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-24git-merge: add support for --commit and --no-squashLars Hjemli
These options can be used to override --no-commit and --squash, which is needed since --no-commit and --squash now can be specified as default merge options in $GIT_DIR/config. The change also introduces slightly different behavior for --no-commit: when specified, it explicitly overrides --squash. Earlier, 'git merge --squash --no-commit' would result in a squashed merge (i.e. no $GIT_DIR/MERGE_HEAD was created) but with this patch the command will behave as if --squash hadn't been specified. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-24git-merge: add support for branch.<name>.mergeoptionsLars Hjemli
This enables per branch configuration of merge options. Currently, the most useful options to specify per branch are --squash, --summary/--no-summary and possibly --strategy, but all options are supported. Note: Options containing whitespace will _not_ be handled correctly. Luckily, the only option which can include whitespace is --message and it doesn't make much sense to give that option a default value. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-24Add test-script for git-merge porcelainLars Hjemli
This test-script excercises the porcelainish aspects of git-merge, and does it thoroughly enough to detect a small bug already noticed by Junio: squashing an octopus generates a faulty .git/SQUASH_MSG. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-21git-svn: handle changed svn command-line syntaxSam Vilain
Previously, if you passed a revision and a path to svn cp, it meant to look back at that revision and select that path. New behaviour is to get the path then go back to the revision (like other commands that accept @REV or -rREV do). The more consistent syntax is not supported by the old tools, so we have to try both in turn. Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-21git-svn: fix test for trunk svn (transaction out of date)Sam Vilain
Older svn clients did not raise a 'transaction out of date' error here, but trunk does - so 'svn up'. Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-21git-svn: fix test for trunk svn (commit message not needed)Sam Vilain
The 'svn mv -m "rename to thunk"' was a local operation, therefore not needing a commit message, it was silently ignored. Newer svn clients will instead raise an error. Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-19Correct handling of branch.$name.merge in builtin-fetchShawn O. Pearce
My prior bug fix for git-push titled "Don't configure remote "." to fetch everything to itself" actually broke t5520 as we were unable to evaluate a branch configuration of: [branch "copy"] remote = . merge = refs/heads/master as remote "." did not have a "remote...fetch" configuration entry to offer up refs/heads/master as a possible candidate available to be fetched and merged. In shell script git-fetch and prior to the above mentioned commit this was hardcoded for a url of "." to be the set of local branches. Chasing down this bug led me to the conclusion that our prior behavior with regards to branch.$name.merge was incorrect. In the shell script based git-fetch implementation we only fetched and merged a branch if it appeared both in branch.$name.merge *and* in remote.$r.fetch, where $r = branch.$name.remote. In other words in the following config file: [remote "origin"] url = git://git.kernel.org/pub/scm/git/git.git fetch = refs/heads/master:refs/remotes/origin/master [branch "master"] remote = origin merge = refs/heads/master [branch "pu"] remote = origin merge = refs/heads/pu Attempting to run `git pull` while on branch "pu" would always give the user "Already up-to-date" as git-fetch did not fetch pu and thus did not mark it for merge in .git/FETCH_HEAD. The configured merge would always be ignored and the user would be left scratching her confused head wondering why merge did not work on "pu" but worked fine on "master". If we are using the "default fetch" specification for the current branch and the current branch has a branch.$name.merge configured we now union it with the list of refs in remote.$r.fetch. This way the above configuration does what the user expects it to do, which is to fetch only "master" by default but when on "pu" to fetch both "master" and "pu". This uncovered some breakage in the test suite where old-style Cogito branches (.git/branches/$r) did not fetch the branches listed in .git/config for merging and thus did not actually merge them if the user tried to use `git pull` on that branch. Junio and I discussed it on list and felt that the union approach here makes more sense to DWIM for the end-user than silently ignoring their configured request so the test vectors for t5515 have been updated to include for-merge lines in .git/FETCH_HEAD where they have been configured for-merge in .git/config. Since we are now performing a union of the fetch specification and the merge specification and we cannot allow a branch to be listed twice (otherwise it comes out twice in .git/FETCH_HEAD) we need to perform a double loop here over all of the branch.$name.merge lines and try to set their merge flag if we have already schedule that branch for fetching by remote.$r.fetch. If no match is found then we must add new specifications to fetch the branch but not store it as no local tracking branch has been designated. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-19Don't attempt to merge non-existant remotes in t5515Shawn O. Pearce
This was actually reverted in 756373da by Junio. We no longer support merging the right hand side of a fetchspec in a branch's branch.$name.merge configuration setting as we interpret these names as being only those published by the remote we are going to fetch from. The older shell based implementation of git-fetch did not report an error when branch.$name.merge was referencing a branch that does not exist on the remote and we are running `git fetch` for the current branch. The new builtin-fetch does notice this failure and aborts the fetch, thus breaking the tests. Junio and I kicked it around on #git earlier today and decided that the best approach here is to error out and tell the user that their configuration is wrong, as this is likely more user friendly than silently ignoring the user's request. Since the new builtin-fetch is already issuing the error there is no code change required, we just need to remove the bad configuration from our test. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-19Make fetch a builtinDaniel Barkalow
Thanks to Johannes Schindelin for review and fixes, and Julian Phillips for the original C translation. This changes a few small bits of behavior: branch.<name>.merge is parsed as if it were the lhs of a fetch refspec, and does not have to exactly match the actual lhs of a refspec, so long as it is a valid abbreviation for the same ref. branch.<name>.merge is no longer ignored if the remote is configured with a branches/* file. Neither behavior is useful, because there can only be one ref that gets fetched, but this is more consistant. Also, fetch prints different information to standard out. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-19Merge branch 'master' into ph/strbufJunio C Hamano
* master: (94 commits) Fixed update-hook example allow-users format. Documentation/git-svn: updated design philosophy notes t/t4014: test "am -3" with mode-only change. git-commit.sh: Shell script cleanup preserve executable bits in zip archives Fix lapsus in builtin-apply.c git-push: documentation and tests for pushing only branches git-svnimport: Use separate arguments in the pipe for git-rev-parse contrib/fast-import: add perl version of simple example contrib/fast-import: add simple shell example rev-list --bisect: Bisection "distance" clean up. rev-list --bisect: Move some bisection code into best_bisection. rev-list --bisect: Move finding bisection into do_find_bisection. 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. send-email: make message-id generation a bit more robust git-apply: fix whitespace stripping git-gui: Disable native platform text selection in "lists" apply --index-info: fall back to current index for mode changes ...
2007-09-19Add post-merge hook, related documentation, and tests.Josh England
The post-merge hook enables one to hook in for `git pull` operations in order to check and/or change attributes of a work tree from the hook. As an example, it can be used in combination with a pre-commit hook to save/restore file ownership and permissions data (or file ACLs) within the repository and transparently update the working tree after a `git pull` operation. Signed-off-by: Josh England <jjengla@sandia.gov> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-19Merge branch 'maint'Junio C Hamano
* maint: Fixed update-hook example allow-users format. Documentation/git-svn: updated design philosophy notes t/t4014: test "am -3" with mode-only change. Fix lapsus in builtin-apply.c git-push: documentation and tests for pushing only branches git-svnimport: Use separate arguments in the pipe for git-rev-parse
2007-09-18t/t4014: test "am -3" with mode-only change.Junio C Hamano
Earlier commit ece7b74903007cee8d280573647243d46a6f3a95 added a test for rebase that uses "am -3", but this adds a test to check "am -3" itself. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-18git-push: documentation and tests for pushing only branchesJeff King
Commit 098e711e caused git-push to match only branches when considering which refs to push. This patch updates the documentation accordingly and adds a test for this behavior. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-18Merge branch 'cr/reset'Junio C Hamano
* cr/reset: Simplify cache API An additional test for "git-reset -- path" Make "git reset" a builtin. Move make_cache_entry() from merge-recursive.c into read-cache.c Add tests for documented features of "git reset".
2007-09-18git-commit: partial commit of paths only removed from the indexJunio C Hamano
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>
2007-09-18git-commit: Allow partial commit of file removal.Junio C Hamano
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>
2007-09-18Merge branch 'jc/grep-c' into maintJunio C Hamano
* jc/grep-c: Split grep arguments in a way that does not requires to add /dev/null.
2007-09-17Merge branch 'maint'Junio C Hamano
* 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
2007-09-17apply --index-info: fall back to current index for mode changesJohannes Schindelin
"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>
2007-09-15revision walker: --cherry-pick is a limited operationJohannes Schindelin
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>
2007-09-15Merge branch 'jc/partial-remove'Junio C Hamano
* 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.
2007-09-14git-commit: partial commit of paths only removed from the indexJunio C Hamano
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>