summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)AuthorFilesLines
2007-10-20git-p4 support for perforce renames.Libravatar Chris Pettitt1-1/+11
The current git-p4 implementation does support file renames. However, because it does not use the "p4 integrate" command, the history for the renamed file is not linked to the new file. This changeset adds support for perforce renames with the integrate command. Currently this feature is only enabled when calling git-p4 submit with the -M option. This is intended to look and behave similar to the "detect renames" feature of other git commands. The following sequence is used for renamed files: p4 integrate -Dt x x' p4 edit x' rm x' git apply p4 delete x By default, perforce will not allow an integration with a target file that has been deleted. That is, if x' in the example above is the name of a previously deleted file then perforce will fail the integrate. The -Dt option tells perforce to allow the target of integrate to be a previously deleted file. Signed-off-by: Chris Pettitt <cpettitt@gmail.com> Signed-off-by: Simon Hausmann <simon@lst.de>
2007-10-20git-p4: When skipping a patch as part of "git-p4 submit" make sure we ↵Libravatar Simon Hausmann1-0/+4
correctly revert to the previous state of the files using "p4 revert". Signed-off-by: Simon Hausmann <simon@lst.de>
2007-10-18Merge branch 'maint'Libravatar Shawn O. Pearce1-1/+1
* maint: Yet more 1.5.3.5 fixes mentioned in release notes cvsserver: Use exit 1 instead of die when req_Root fails. git-blame shouldn't crash if run in an unmerged tree git-config: print error message if the config file cannot be read fixing output of non-fast-forward output of post-receive-email
2007-10-18fixing output of non-fast-forward output of post-receive-emailLibravatar Robert Schiele1-1/+1
post-receive-email has one place where the variable fast_forward is not spelled correctly. At the same place the logic was reversed. The combination of both bugs made the script work correctly for fast-forward commits but not for non-fast-forward ones. This change fixes this to be correct in both cases. Signed-off-by: Robert Schiele <rschiele@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15Minor usage update in setgitperms.perlLibravatar Josh England1-3/+4
Signed-off-by: Josh England <jjengla@sandia.gov> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15Add 'git-p4 commit' as an alias for 'git-p4 submit'Libravatar Marius Storm-Olsen1-0/+1
Given that git uses 'commit', git-p4's 'sumbit' was a bit confusing at times; often making me do 'git submit' and 'git-p4 commit' instead. Signed-off-by: Marius Storm-Olsen <marius@trolltech.com> Acked-By: Simon Hausmann <simon@lst.de> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15hg-to-git speedup through selectable repack intervalsLibravatar Michael Gebetsroither1-3/+11
Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15gtksourceview2 support for gitviewLibravatar Frederick Akalin1-22/+31
Added support for gtksourceview2 module (pygtksourceview 1.90.x) in gitview. Also refactored code that creates the source buffer and view. Signed-off-by: Frederick Akalin <akalin@akalin.cx> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15fix contrib/hooks/post-receive-email hooks.recipients error messageLibravatar Jeff Muizelaar1-1/+9
Have the error message for missing recipients actually report the missing config variable and not a fictional one. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-01Merge branch 'maint'Libravatar Junio C Hamano1-1/+0
* maint: Whip post 1.5.3.3 maintenance series into shape. git stash: document apply's --index switch post-receive-hook: Remove the From field from the generated email header so that the pusher's name is used
2007-10-01post-receive-hook: Remove the From field from the generated email header so ↵Libravatar Andy Parkins1-1/+0
that the pusher's name is used Using the name of the committer of the revision at the tip of the updated ref is not sensible. That information is available in the email itself should it be wanted, and by supplying a "From", we were effectively hiding the person who performed the push - which is useful information in itself. Signed-off-by: Andy Parkins <andyparkins@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29git.el: Reset the permission flags when changing a file state.Libravatar Alexandre Julliard1-17/+11
Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29git.el: Update a file status in the git buffer upon save.Libravatar Alexandre Julliard1-2/+16
Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29git.el: Do not print a status message on every git command.Libravatar Alexandre Julliard1-29/+41
Instead print a single message around sequences of commands that can potentially take some time. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29git.el: Preserve file marks when doing a full refresh.Libravatar Alexandre Julliard1-12/+28
Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25Move convert-objects to contrib.Libravatar Matt Kraai3-1/+357
convert-objects was needed to convert from an old-style repository, which hashed the compressed contents and used a different date format. Such repositories are presumably no longer common and, if such conversions are necessary, should be done by writing a frontend for git-fast-import. Linus, the original author, is OK with moving it to contrib. Signed-off-by: Matt Kraai <kraai@ftbfs.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25Merge branch 'maint'Libravatar Junio C Hamano1-6/+10
* 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-25Do not over-quote the -f envelopesender value.Libravatar Jim Meyering1-6/+10
Without this, the value passed to sendmail would have an extra set of single quotes. At least exim's sendmail emulation would object to that: exim: bad -f address "'list-addr@example.org'": malformed address: ' \ may not follow 'list-addr@example.org error: hooks/post-receive exited with error code 1 Signed-off-by: Jim Meyering <jim@meyering.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-23Merge branch 'je/hooks'Libravatar Junio C Hamano1-0/+213
* je/hooks: Added example hook script to save/restore permissions/ownership. Add post-merge hook, related documentation, and tests.
2007-09-23Merge branch 'maint'Libravatar Junio C Hamano5-5/+13
* maint: git-svn: don't attempt to spawn pager if we don't want one Supplant the "while case ... break ;; esac" idiom User Manual: add a chapter for submodules user-manual: don't assume refs are stored under .git/refs Detect exec bit in more cases. Conjugate "search" correctly in the git-prune-packed man page. Move the paragraph specifying where the .idx and .pack files should be Documentation/git-lost-found.txt: drop unnecessarily duplicated name.
2007-09-23Supplant the "while case ... break ;; esac" idiomLibravatar David Kastrup3-3/+3
A lot of shell scripts contained stuff starting with while case "$#" in 0) break ;; esac and similar. I consider breaking out of the condition instead of the body od the loop ugly, and the implied "true" value of the non-matching case is not really obvious to humans at first glance. It happens not to be obvious to some BSD shells, either, but that's because they are not POSIX-compliant. In most cases, this has been replaced by a straight condition using "test". "case" has the advantage of being faster than "test" on vintage shells where "test" is not a builtin. Since none of them is likely to run the git scripts, anyway, the added readability should be worth the change. A few loops have had their termination condition expressed differently. Signed-off-by: David Kastrup <dak@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-22Detect exec bit in more cases.Libravatar David Brown1-1/+9
git-p4 was missing the execute bit setting if the file had other attribute bits set. Acked-By: Simon Hausmann <simon@lst.de>
2007-09-18Added example hook script to save/restore permissions/ownership.Libravatar Josh England1-0/+213
Usage info is emebed in the script, but the gist of it is to run the script from a pre-commit hook to save permissions/ownership data to a file and check that file into the repository. Then, a post_merge hook reads the file and updates working tree permissions/ownership. All updates are transparent to the user (although there is a --verbose option). Merge conflicts are handled in the "read" phase (in pre-commit), and the script aborts the commit and tells you how to fix things in the case of a merge conflict in the metadata file. This same idea could be extended to handle file ACLs or other file metadata if desired. Signed-off-by: Josh England <jjengla@sandia.gov> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-18contrib/fast-import: add perl version of simple exampleLibravatar Jeff King1-0/+64
This is based on the git-import.sh script, but is a little more robust and efficient. More importantly, it should serve as a quick template for interfacing fast-import with perl scripts. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-18contrib/fast-import: add simple shell exampleLibravatar Nguyen Thai Ngoc Duy1-0/+38
This example just puts a directory under git control. It is significantly slower than using the git tools directly, but hopefully shows a bit how fast-import works. [jk: added header comments] Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-14Merge branch 'jc/cachetree' into cr/resetLibravatar Junio C Hamano1-54/+143
* jc/cachetree: Simplify cache API git-format-patch --in-reply-to: accept <message@id> with angle brackets git-add -u: do not barf on type changes Remove duplicate note about removing commits with git-filter-branch git-clone: improve error message if curl program is missing or not executable git.el: Allow the add and remove commands to be applied to ignored files. git.el: Allow selecting whether to display uptodate/unknown/ignored files. git.el: Keep the status buffer sorted by filename. hooks--update: Explicitly check for all zeros for a deleted ref.
2007-09-13git.el: Allow the add and remove commands to be applied to ignored files.Libravatar Alexandre Julliard1-2/+2
Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13git.el: Allow selecting whether to display uptodate/unknown/ignored files.Libravatar Alexandre Julliard1-15/+77
The default behavior for each state can be customized, and it can also be toggled directly from the status buffer. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13git.el: Keep the status buffer sorted by filename.Libravatar Alexandre Julliard1-38/+65
This makes insertions and updates much more efficient. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-12Make "git reset" a builtin.Libravatar Carlos Rica1-0/+106
This replaces the script "git-reset.sh" with "builtin-reset.c". A few git commands used in the script are called from the builtin also: "ls-files" to check for unmerged files, "read-tree" for resetting the index file in "mixed" and "hard" resets, and "update-index" to refresh at the end in the "mixed" reset and also for the option that gets selected paths into the index. The reset option with paths was implemented by Johannes Schindelin. Since the option that gets selected paths into the index is not a "reset" like the others because it does not change the HEAD at all, now the command is showing a warning when the "--mixed" option is supplied for that purpose. The following table shows the behaviour of "git reset" for the different supported options, where X means "changing" the HEAD, index or working tree: reset: --soft --mixed --hard -- <paths> HEAD X X X - index - X X X files - - X - Signed-off-by: Carlos Rica <jasampler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-06Merge branch 'master' of git://repo.or.cz/git/git-p4Libravatar Junio C Hamano1-130/+212
* 'master' of git://repo.or.cz/git/git-p4: git-p4: Added support for automatically importing newly appearing perforce branches. git-p4: Cleanup; moved the (duplicated) code for turning a branch into a git ref (for example foo -> refs/remotes/p4/<project>/foo) into a separate method. git-p4: Cleanup; moved the code for the initial #head or revision import into a separate function, out of P4Sync.run. git-p4: Cleanup; Turn self.revision into a function local variable (it's not used anywhere outside the function). git-p4: Cleanup; moved the code to import a list of p4 changes using fast-import into a separate member function of P4Sync. git-p4: Cleanup; moved the code for getting a sorted list of p4 changes for a list of given depot paths into a standalone method. git-p4: After submission to p4 always synchronize from p4 again (into refs/remotes). Whether to rebase HEAD or not is still left as question to the end-user. git-p4: Always call 'p4 sync ...' before submitting to Perforce.
2007-09-05Don't allow contrib/workdir/git-new-workdir to trash existing dirsLibravatar Shawn O. Pearce1-0/+6
Recently I found that doing a sequence like the following: git-new-workdir a b ... git-new-workdir a b by accident will cause a (and now also b) to have an infinite cycle in its refs directory. This is caused by git-new-workdir trying to create the "refs" symlink over again, only during the second time it is being created within a's refs directory and is now also pointing back at a's refs. This causes confusion in git as suddenly branches are named things like "refs/refs/refs/refs/refs/refs/refs/heads/foo" instead of the more commonly accepted "refs/heads/foo". Plenty of commands start to see ambiguous ref names and others just take ages to compute. git-clone has the same safety check, so git-new-workdir should behave just like it. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-03git-p4: Added support for automatically importing newly appearing perforce ↵Libravatar Simon Hausmann1-2/+74
branches. If a change in a p4 "branch" appears that hasn't seen any previous commit and that has a known branch mapping we now try to import it properly. First we find the p4 change of the source branch that the new p4 branch is based on. Then we using git rev-list --bisect to locate the corresponding git commit to that change. Finally we import all changes in the new p4 branch up to the current change and resume with the regular import. Signed-off-by: Simon Hausmann <simon@lst.de>
2007-09-03git-p4: Cleanup; moved the (duplicated) code for turning a branch into a git ↵Libravatar Simon Hausmann1-17/+11
ref (for example foo -> refs/remotes/p4/<project>/foo) into a separate method. Signed-off-by: Simon Hausmann <simon@lst.de>
2007-09-03git-p4: Cleanup; moved the code for the initial #head or revision import ↵Libravatar Simon Hausmann1-42/+45
into a separate function, out of P4Sync.run. Signed-off-by: Simon Hausmann <simon@lst.de>
2007-09-03git-p4: Cleanup; Turn self.revision into a function local variable (it's not ↵Libravatar Simon Hausmann1-9/+9
used anywhere outside the function). Signed-off-by: Simon Hausmann <simon@lst.de>
2007-09-03git-p4: Cleanup; moved the code to import a list of p4 changes using ↵Libravatar Simon Hausmann1-69/+71
fast-import into a separate member function of P4Sync. Signed-off-by: Simon Hausmann <simon@lst.de>
2007-09-03git-p4: Cleanup; moved the code for getting a sorted list of p4 changes for ↵Libravatar Simon Hausmann1-9/+14
a list of given depot paths into a standalone method. Signed-off-by: Simon Hausmann <simon@lst.de>
2007-09-03git-p4: After submission to p4 always synchronize from p4 again (into ↵Libravatar Simon Hausmann1-2/+9
refs/remotes). Whether to rebase HEAD or not is still left as question to the end-user. Signed-off-by: Simon Hausmann <simon@lst.de>
2007-09-03git-p4: Always call 'p4 sync ...' before submitting to Perforce.Libravatar Simon Hausmann1-3/+2
Acked-by: Marius Storm-Olsen <marius@trolltech.com> Acked-by: Thiago Macieira <thiago@kde.org>
2007-08-31Teach bash about completing arguments for git-tagLibravatar Shawn O. Pearce1-0/+58
Lately I have been doing a lot of calls to `git tag -d` and also to `git tag -v`. In both such cases being able to complete the names of existing tags saves the fingers some typing effort. We now look for the -d or -v option to git-tag in the bash completion support and offer up existing tag names as possible choices for these. When creating a new tag we now also offer bash completion support for the second argument to git-tag (the object to be tagged) as this can often be a specific existing branch name and is not necessarily the current HEAD. If the -f option is being used to recreate an existing tag we now also offer completion support on the existing tag names for the first argument of git-tag, helping to the user to reselect the prior tag name that they are trying to replace. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-29completion: also complete git-log's --left-right and --cherry-pick optionLibravatar Johannes Schindelin1-0/+1
Both --left-right and --cherry-pick are particularly long to type, so help the user there. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-29git.el: Added colors for dark backgroundLibravatar David Kågedal1-9/+18
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-24git-p4: Fix warnings about non-existant refs/remotes/p4/HEAD ref when ↵Libravatar Simon Hausmann1-1/+1
running git-p4 sync the first time after a git clone. Don't create the p4/HEAD symbolic ref if p4/master doesn't exist yet. Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-24git-p4: Make 'git-p4 branches' work after an initial clone with git clone ↵Libravatar Simon Hausmann1-49/+55
from an origin-updated repository. After a clone with "git clone" of a repository the p4 branches are only in remotes/origin/p4/* and not in remotes/p4/*. Separate the code for detection and creation out of the P4Sync command class into standalone methods and use them from the P4Branches command. Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-23Teach bash about git-submodule and its subcommandsLibravatar Shawn O. Pearce1-0/+27
The git-submodule command is new in 1.5.3 and contains a number of useful subcommands for working on submodules. We usually try to offer the subcommands of a git command in the bash completion, so here they are for git-submodule. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-23Teach bash to complete ref arguments to git-describeLibravatar Shawn O. Pearce1-0/+8
I'm often finding that I need to run git-describe on very long remote tracking branch names, to find out what tagged revision the remote tracking branch is now at (or not at). Typing out the ref names is painful, so bash completion on them is a very useful feature. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-23Update bash completion with new 1.5.3 command line optionsLibravatar Shawn O. Pearce1-6/+26
A number of commands have learned new tricks as part of git 1.5.3. If these are long options (--foo) we tend to support them in the bash completion, as it makes the user's task of using the option slightly easier. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-22git.el: Avoid a lisp error when there's no current branch (detached HEAD).Libravatar Alexandre Julliard1-3/+5
Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-22Suggest unsetting core.bare when using new-workdir on a bare repositoryLibravatar Shawn O. Pearce1-0/+8
If core.bare is set to true in the config file of a repository that the user is trying to create a working directory from we should abort and suggest to the user that they remove the option first. If we leave the core.bare=true setting in the config file then working tree operations will get confused when they attempt to execute in the new workdir, as it shares its config file with the bare repository. The working tree operations will assume that the workdir is bare and abort, which is not what the user wants. If we changed core.bare to be false then working tree operations will function in the workdir but other operations may fail in the bare repository, as it claims to not be bare. If we remove core.bare from the config then Git can fallback on the legacy guessing behavior. This allows operations in the bare repository to work as though it were bare, while operations in the workdirs to act as though they are not bare. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>