summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-01-21Simplify parsing branch switching events in reflogLibravatar Junio C Hamano1-6/+2
We only accept "checkout: moving from A to B" newer style reflog entries, in order to pick up A. There is no point computing where B begins at after running strstr to locate " to ", nor adding 4 and then subtracting 4 from the same pointer. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-19Introduce for_each_recent_reflog_ent().Libravatar Junio C Hamano3-2/+24
This can be used to scan only the last few kilobytes of a reflog, as a cheap optimization when the data you are looking for is likely to be found near the end of it. The caller is expected to fall back to the full scan if that is not the case. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-19interpret_nth_last_branch(): plug small memleakLibravatar Junio C Hamano1-3/+7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-19Fix reflog parsing for a malformed branch switching entryLibravatar Junio C Hamano1-1/+1
target can be NULL when we failed to parse the message. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-19Fix parsing of @{-1}@{1}Libravatar Johannes Schindelin2-2/+25
To do that, Git no longer looks forward for the '@{' corresponding to the closing '}' but backward, and dwim_ref() as well as dwim_log() learnt about the @{-<N>} notation. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-19interpret_nth_last_branch(): avoid traversing the reflog twiceLibravatar Junio C Hamano2-24/+65
You can have quite a many reflog entries, but you typically won't recall which branch you were on after switching branches for more than several times. Instead of reading the reflog twice, this reads the branch switching event and keeps as many entries as the user asked from the latest such entries, which is the minimum required to be able to switch back to the branch we were recently on. [jc: improvements from Dscho squashed in] Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17checkout: implement "-" abbreviation, add docs and testsLibravatar Thomas Rast3-0/+57
Have '-' mean the same as '@{-1}', i.e., the last branch we were on. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17sha1_name: support @{-N} syntax in get_sha1()Libravatar Thomas Rast3-3/+87
Let get_sha1() parse the @{-N} syntax, with docs and tests. Note that while @{-1}^2, @{-2}~5 and such are supported, @{-1}@{1} is currently not allowed. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17sha1_name: tweak @{-N} lookupLibravatar Thomas Rast2-25/+32
Have the lookup only look at "interesting" checkouts, meaning those that tell you "Already on ..." don't count even though they also cause a reflog entry. Let interpret_nth_last_branch() return the number of characters parsed, so that git-checkout can verify that the branch spec was @{-N}, not @{-1}^2 or something like that. (The latter will be added later.) Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17checkout: implement "@{-N}" shortcut name for N-th last branchLibravatar Junio C Hamano3-2/+87
Implement a shortcut @{-N} for the N-th last branch checked out, that works by parsing the reflog for the message added by previous git-checkout invocations. We expand the @{-N} to the branch name, so that you end up on an attached HEAD on that branch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15Merge branch 'maint'Libravatar Junio C Hamano2-0/+34
* maint: t3404: Add test case for auto-amending only edited commits after "edit" t3404: Add test case for aborted --continue after "edit" t3501: check that commits are actually done
2009-01-15Merge branch 'maint-1.6.0' into maintLibravatar Junio C Hamano2-0/+34
* maint-1.6.0: t3404: Add test case for auto-amending only edited commits after "edit" t3404: Add test case for aborted --continue after "edit" t3501: check that commits are actually done
2009-01-15t3404: Add test case for auto-amending only edited commits after "edit"Libravatar Stephan Beyer1-0/+17
Add a test case for the bugfix introduced by commit c14c3c82d "git-rebase--interactive: auto amend only edited commit". Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15t3404: Add test case for aborted --continue after "edit"Libravatar Stephan Beyer1-0/+15
Add a test case for the bugfix introduced by commit 8beb1f33d "git-rebase-interactive: do not squash commits on abort". Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15t3501: check that commits are actually doneLibravatar Stephan Beyer1-0/+2
The basic idea of t3501 is to check whether revert and cherry-pick works on renamed files. But as there is no pure cherry-pick/revert test, it is good to also check if commits are actually done in that scenario. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15bash-completion: Add comments to remind about required argumentsLibravatar Ted Pavlic1-0/+15
Add a few simple comments above commands that take arguments. These comments are meant to remind developers of potential problems that can occur when the script is sourced on systems with "set -u." Any function which requires arguments really ought to be called with explicit arguments given. Also adds a #!bash to the top of bash completions so that editing software can always identify that the file is of sh type. Signed-off-by: Ted Pavlic <ted@tedpavlic.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15bash-completion: Try bash completions before simple filetypeLibravatar Ted Pavlic1-3/+6
When a git completion is not found, a bash shell should try bash-type completions first before going to standard filetype completions. This patch adds "-o bashdefault" to the completion line. If that option is not available, it uses the old method. This behavior was inspired by Mercurial's bash completion script. Signed-off-by: Ted Pavlic <ted@tedpavlic.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15bash-completion: Support running when set -u is enabledLibravatar Ted Pavlic1-9/+9
Under "set -u" semantics, it is an error to access undefined variables. Some user environments may enable this setting in the interactive shell. In any context where the completion functions access an undefined variable, accessing a default empty string (aka "${1-}" instead of "$1") is a reasonable way to code the function, as it silences the undefined variable error while still supplying an empty string. In this patch, functions that should always take an argument still use $1. Functions that have optional arguments use ${1-}. Signed-off-by: Ted Pavlic <ted@tedpavlic.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14Merge branch 'maint'Libravatar Junio C Hamano4-2/+49
* maint: Update draft release notes to 1.6.1.1 Make t3411 executable fix handling of multiple untracked files for git mv -k add test cases for "git mv -k"
2009-01-14Update draft release notes to 1.6.1.1Libravatar Junio C Hamano1-2/+23
2009-01-14Merge branch 'maint-1.6.0' into maintLibravatar Junio C Hamano2-0/+26
* maint-1.6.0: fix handling of multiple untracked files for git mv -k add test cases for "git mv -k"
2009-01-14Make t3411 executableLibravatar Miklos Vajna1-0/+0
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14fix handling of multiple untracked files for git mv -kLibravatar Michael J Gruber2-1/+2
The "-k" option to "git mv" should allow specifying multiple untracked files. Currently, multiple untracked files raise an assertion if they appear consecutively as arguments. Fix this by decrementing the loop index after removing one entry from the array of arguments. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14add test cases for "git mv -k"Libravatar Michael J Gruber1-0/+25
Add test cases for ignoring nonexisting and untracked files using the -k option to "git mv". There is one known breakage related to multiple untracked files specfied as consecutive arguments. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-13Update 1.6.2 draft release notesLibravatar Junio C Hamano1-1/+38
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-13Merge branch 'maint'Libravatar Junio C Hamano2-5/+6
* maint: fast-import: Cleanup mode setting. Git.pm: call Error::Simple() properly
2009-01-13Merge branch 'maint-1.6.0' into maintLibravatar Junio C Hamano2-5/+6
* maint-1.6.0: fast-import: Cleanup mode setting. Git.pm: call Error::Simple() properly
2009-01-13Merge branch 'nd/grep-assume-unchanged'Libravatar Junio C Hamano2-2/+20
* nd/grep-assume-unchanged: grep: grep cache entries if they are "assume unchanged" grep: support --no-ext-grep to test builtin grep
2009-01-13Merge branch 'as/maint-shortlog-cleanup'Libravatar Junio C Hamano1-16/+3
* as/maint-shortlog-cleanup: builtin-shortlog.c: use string_list_append(), and don't strdup unnecessarily
2009-01-13Merge branch 'jc/maint-ls-tree'Libravatar Junio C Hamano2-2/+13
* jc/maint-ls-tree: Document git-ls-tree --full-tree ls-tree: add --full-tree option
2009-01-13Merge branch 'js/bundle-tags'Libravatar Junio C Hamano2-0/+65
* js/bundle-tags: bundle: allow rev-list options to exclude annotated tags
2009-01-13Merge branch 'js/add-not-submodule'Libravatar Junio C Hamano2-0/+53
* js/add-not-submodule: git add: do not add files from a submodule
2009-01-13Merge branch 'pb/maint-git-pm-false-dir'Libravatar Junio C Hamano1-3/+4
* pb/maint-git-pm-false-dir: Git.pm: correctly handle directory name that evaluates to "false"
2009-01-13Merge branch 'pj/maint-ldflags'Libravatar Junio C Hamano1-2/+2
* pj/maint-ldflags: configure clobbers LDFLAGS
2009-01-13Merge branch 'fe/cvsserver'Libravatar Junio C Hamano2-4/+20
* fe/cvsserver: cvsserver: change generation of CVS author names cvsserver: add option to configure commit message
2009-01-13Merge branch 'js/maint-bisect-gitk'Libravatar Junio C Hamano1-1/+1
* js/maint-bisect-gitk: bisect view: call gitk if Cygwin's SESSIONNAME variable is set
2009-01-13Merge branch 'np/no-loosen-prune-expire-now'Libravatar Junio C Hamano2-3/+9
* np/no-loosen-prune-expire-now: objects to be pruned immediately don't have to be loosened
2009-01-13Merge branch 'cb/maint-unpack-trees-absense'Libravatar Junio C Hamano2-18/+67
* cb/maint-unpack-trees-absense: unpack-trees: remove redundant path search in verify_absent unpack-trees: fix path search bug in verify_absent unpack-trees: handle failure in verify_absent
2009-01-13Merge branch 'mc/cd-p-pwd'Libravatar Junio C Hamano2-3/+3
* mc/cd-p-pwd: git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X
2009-01-13Merge branch 'mh/cherry-default'Libravatar Junio C Hamano2-3/+16
* mh/cherry-default: Documentation: clarify which parameters are optional to git-cherry git-cherry: make <upstream> parameter optional
2009-01-13fast-import: Cleanup mode setting.Libravatar Felipe Contreras1-3/+4
"S_IFREG | mode" makes only sense for 0644 and 0755. Even though doing (S_IFREG | mode) may not hurt when mode is any other supported value, that is only true because S_IFREG mode bit happens to be already on for S_IFLNK or S_IFGITLINK. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-13Git.pm: call Error::Simple() properlyLibravatar Jay Soffian1-2/+2
The error message to Error::Simple() must be passed as a single argument. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-13Merge branch 'maint'Libravatar Junio C Hamano2-1/+4
* maint: Avoid spurious error messages on error mistakes. contrib/examples/README: give an explanation of the status of these files
2009-01-13Merge branch 'kk/maint-http-push' into maintLibravatar Junio C Hamano1-6/+19
* kk/maint-http-push: http-push: support full URI in handle_remote_ls_ctx()
2009-01-13Merge branch 'js/maint-merge-recursive-r-d-conflict' into maintLibravatar Junio C Hamano2-0/+28
* js/maint-merge-recursive-r-d-conflict: merge-recursive: mark rename/delete conflict as unmerged
2009-01-13Merge branch 'cb/maint-merge-recursive-fix' into maintLibravatar Junio C Hamano2-0/+119
* cb/maint-merge-recursive-fix: merge-recursive: do not clobber untracked working tree garbage modify/delete conflict resolution overwrites untracked file Conflicts: builtin-merge-recursive.c
2009-01-13Merge branch 'ap/maint-apply-modefix' into maintLibravatar Junio C Hamano2-1/+65
* ap/maint-apply-modefix: builtin-apply: prevent non-explicit permission changes
2009-01-13Merge branch 'maint-1.6.0' into maintLibravatar Junio C Hamano2-1/+4
* maint-1.6.0: Avoid spurious error messages on error mistakes. contrib/examples/README: give an explanation of the status of these files
2009-01-13Avoid spurious error messages on error mistakes.Libravatar Pierre Habouzit1-1/+1
Prior to that, if the user chose "squash" as a first action, the stderr looked like: grep: /home/madcoder/dev/scm/git/.git/rebase-merge/done: No such file or directory Cannot 'squash' without a previous commit Now the first line is gone. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-13Fix Documentation typos surrounding the word 'handful'.Libravatar Jon Loeliger8-11/+11
Some instances replaced by "handful of", others use the word "few", a couple get a slight rewording. Signed-off-by: Jon Loeliger <jdl@freescale.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>