aboutsummaryrefslogtreecommitdiff
path: root/contrib
Commit message (Collapse)AuthorAge
* fixing output of non-fast-forward output of post-receive-emailRobert Schiele2007-10-18
| | | | | | | | | | | 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>
* post-receive-hook: Remove the From field from the generated email header so ↵Andy Parkins2007-10-01
| | | | | | | | | | | | | 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>
* Do not over-quote the -f envelopesender value.Jim Meyering2007-09-25
| | | | | | | | | | | | 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>
* Supplant the "while case ... break ;; esac" idiomDavid Kastrup2007-09-23
| | | | | | | | | | | | | | | | | | | | | | 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>
* Detect exec bit in more cases.David Brown2007-09-22
| | | | | | | git-p4 was missing the execute bit setting if the file had other attribute bits set. Acked-By: Simon Hausmann <simon@lst.de>
* Don't allow contrib/workdir/git-new-workdir to trash existing dirsShawn O. Pearce2007-09-05
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Teach bash about completing arguments for git-tagShawn O. Pearce2007-08-31
| | | | | | | | | | | | | | | | | | | | 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>
* completion: also complete git-log's --left-right and --cherry-pick optionJohannes Schindelin2007-08-29
| | | | | | | | 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>
* git.el: Added colors for dark backgroundDavid Kågedal2007-08-29
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Fix warnings about non-existant refs/remotes/p4/HEAD ref when ↵Simon Hausmann2007-08-24
| | | | | | | | | 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>
* git-p4: Make 'git-p4 branches' work after an initial clone with git clone ↵Simon Hausmann2007-08-24
| | | | | | | | | | | 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>
* Teach bash about git-submodule and its subcommandsShawn O. Pearce2007-08-23
| | | | | | | | | 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>
* Teach bash to complete ref arguments to git-describeShawn O. Pearce2007-08-23
| | | | | | | | | | 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>
* Update bash completion with new 1.5.3 command line optionsShawn O. Pearce2007-08-23
| | | | | | | | | 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>
* git.el: Avoid a lisp error when there's no current branch (detached HEAD).Alexandre Julliard2007-08-22
| | | | | Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Suggest unsetting core.bare when using new-workdir on a bare repositoryShawn O. Pearce2007-08-22
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix new-workdir (again) to work on bare repositoriesShawn O. Pearce2007-08-22
| | | | | | | | | | | | | | | | My day-job workflow involves using multiple workdirs attached to a bunch of bare repositories. Such repositories are stored inside of a directory called "foo.git", which means `git rev-parse --git-dir` will return "." and not ".git". Under such conditions new-workdir was getting confused about where the Git repository it was supplied is actually located. If we get "." for the result of --git-dir query it means we should use the user supplied path as-is, and not attempt to perform any magic on it, as the path is directly to the repository. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-completion.bash - add support for git-bundleMark Levedahl2007-08-19
| | | | | Signed-off-by: Mark Levedahl <mdl123@verizon.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* git-p4: Fix the sorting of changelists when cloning a Perforce repository.Reece H. Dunn2007-08-13
| | | | | | | | | | | When performing a git-p4 clone operation on a Perforce repository, where the changelists change in order of magnitude (e.g. 100 to 1000), the set of changes to import from is not sorted properly. This is because the data in the list is strings not integers. The other place where this is done already converts the value to an integer, so it is not affected. Acked-by: Simon Hausmann <simon@lst.de>
* git.el: Always set the current directory in the git-diff buffer.Alexandre Julliard2007-08-13
| | | | | | | This allows jumping to the correct file with the diff-mode commands. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git.el: Add support for interactive diffs.Alexandre Julliard2007-08-13
| | | | | Signed-off-by: Alexandre Julliard <julliard@winehq.org> 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.
| * Make verify-tag a builtin.Carlos Rica2007-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces "git-verify-tag.sh" with "builtin-verify-tag.c". Testing relies on the "git tag -v" tests calling this command. A temporary file is needed when calling to gpg, because git is already creating detached signatures (gpg option -b) to sign tags (instead of leaving gpg to add the signature to the file by itself), and those signatures need to be supplied in a separate file to be verified by gpg. The program uses git_mkstemp to create that temporary file needed by gpg, instead of the previously used "$GIT_DIR/.tmp-vtag", in order to allow the command to be used in read-only repositories, and also prevent other instances of git to read or remove the same file. Signal SIGPIPE is ignored because the program sometimes was terminated because that signal when writing the input for gpg. The command now can receive many tag names to be verified. Documentation is also updated here to reflect this new behaviour. Signed-off-by: Carlos Rica <jasampler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Make git tag a builtin.Carlos Rica2007-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the script "git-tag.sh" with "builtin-tag.c". The existing test suite for "git tag" guarantees the compatibility with the features provided by the script version. There are some minor changes in the behaviour of "git tag" here: "git tag -v" now can get more than one tag to verify, like "git tag -d" does, "git tag" with no arguments prints all tags, more like "git branch" does, and "git tag -n" also prints all tags with annotations (without needing -l). Tests and documentation were also updated to reflect these changes. The program is currently calling the script "git verify-tag" for verify. This can be changed porting it to C and calling its functions directly from builtin-tag.c. Signed-off-by: Carlos Rica <jasampler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Use the empty tree for base diff in paranoid-update on new branchesShawn O. Pearce2007-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to load a tree difference for the purpose of testing file patterns. But if our branch is being created and there is no specific base to difference against in the rule our base will be '0'x40. This is (usually) not a valid tree-ish object in a Git repository, so there's nothing to difference against. Instead of creating the empty tree and running git-diff against that we just take the output of `ls-tree -r --name-only` and mark every returned pathname as an add. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Teach the update-paranoid to look at file differencesShawn O. Pearce2007-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some applications of the update hook a user may be allowed to modify a branch, but only if the file level difference is also an allowed change. This is the commonly requested feature of allowing users to modify only certain files. A new repository.*.allow syntax permits granting the three basic file level operations: A: file is added relative to the other tree M: file exists in both trees, but its SHA-1 or mode differs D: file is removed relative to the other tree on a per-branch and path-name basis. The user must also have a branch level allow line already granting them access to create, rewind or update (CRU) that branch before the hook will consult any file level rules. In order for a branch change to succeed _all_ files that differ relative to some base (by default the old value of this branch, but it can also be any valid tree-ish) must be allowed by file level allow rules. A push is rejected if any diff exists that is not covered by at least one allow rule. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Teach update-paranoid how to store ACLs organized by groupsShawn O. Pearce2007-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some applications of this paranoid update hook the set of ACL rules that need to be applied to a user can be large, and the number of users that those rules must also be applied to can be more than a handful of individuals. Rather than repeating the same rules multiple times (once for each user) we now allow users to be members of groups, where the group supplies the list of ACL rules. For various reasons we don't depend on the underlying OS groups and instead perform our own group handling. Users can be made a member of one or more groups by setting the user.memberOf property within the "users/$who.acl" file: [user] memberOf = developer memberOf = administrator This will cause the hook to also parse the "groups/$groupname.acl" file for each value of user.memberOf, and merge any allow rules that match the current repository with the user's own private rules (if they had any). Since some rules are basically the same but may have a component differ based on the individual user, any user.* key may be inserted into a rule using the "${user.foo}" syntax. The allow rule does not match if the user does not define one (and exactly one) value for the key "foo". Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-p4: Fix git-p4 submit to include only changed files in the perforce ↵Simon Hausmann2007-08-08
| | | | | | | | | | | | | | | | | | | | submit template. Parse the files section in the "p4 change -o" output and remove lines with file changes in unrelated depot paths. Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Marius Storm-Olsen <marius@trolltech.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-p4: Fix support for symlinks.Simon Hausmann2007-08-08
| | | | | | | | | | | | | | | | | | Detect symlinks as file type, set the git file mode accordingly and strip off the trailing newline in the p4 print output. Make the mode handling a bit more readable at the same time. Signed-off-by: Simon Hausmann <simon@lst.de> Acked-by: Brian Swetland <swetland@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | INSTALL: add warning on docbook-xsl 1.72 and 1.73Junio C Hamano2007-08-04
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-completion: add "git stash"Junio C Hamano2007-08-04
| | | | | | | | | | | | | | | | | | | | This is a new addition to 1.5.3; let's teach it to the completion before the final release. [sp: Added missing git-stash completion configuration] Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Fix style nit in Python slicing.Han-Wen Nienhuys2007-08-02
| | | | | | | | | | | | | | Python slices start at 0 by default. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Simon Hausmann <simon@lst.de>
* | Sort output of "p4 change" in incremental import before furtherHan-Wen Nienhuys2007-08-02
| | | | | | | | | | | | | | | | | | | | processing P4 change outputs the changes sorted for each directory separately. We want the global ordering on the changes, hence we sort. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Simon Hausmann <simon@lst.de>
* | git.el: Take into account the core.excludesfile config option.Alexandre Julliard2007-07-31
| | | | | | | | | | | | | | | | | | Also don't require .git/info/exclude to exist in order to list unknown files. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Acked-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git.el: Avoid using ewoc-set-data for compatibility with Emacs 21.Alexandre Julliard2007-07-31
| | | | | | | | | | | | Signed-off-by: Alexandre Julliard <julliard@winehq.org> Acked-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-p4: Fix p4 user cache population on Windows.Simon Hausmann2007-07-25
| | | | | | | | | | | | | | | | Fall back to USERPROFILE if HOME isn't set. Signed-off-by: Simon Hausmann <shausman@trolltech.com> Signed-off-by: Marius Storm-Olsen <marius@trolltech.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git.el: Pass an explicit argument to enable smerge-mode.Alexandre Julliard2007-07-25
| | | | | | | | | | | | | | | | Without argument the mode is toggled, which would do the wrong thing if the file was already open. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git.el: Support for incremental status updates.Alexandre Julliard2007-07-24
|/ | | | | | | | | | | | When we know which files have been modified, we can now run diff-index or ls-files with a file list to refresh only the specified files instead of the whole project. This also allows proper refreshing of files upon add/delete/resolve, instead of making assumptions about the new file state. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'master' of git://people.freedesktop.org/~hausmann/git-p4Junio C Hamano2007-07-18
|\ | | | | | | | | | | | | | | | | * 'master' of git://people.freedesktop.org/~hausmann/git-p4: git-p4: Cleanup, used common function for listing imported p4 branches git-p4: Fix upstream branch detection for submit/rebase with multiple branches. git-p4: Cleanup, make listExistingP4Branches a global function for later use. git-p4: input to "p4 files" by stdin instead of arguments git-p4: use subprocess in p4CmdList
| * git-p4: Cleanup, used common function for listing imported p4 branchesSimon Hausmann2007-07-18
| | | | | | | | Signed-off-by: Simon Hausmann <simon@lst.de>
| * git-p4: Fix upstream branch detection for submit/rebase with multiple branches.Simon Hausmann2007-07-18
| | | | | | | | | | | | | | | | Don't use git name-rev to locate the upstream git-p4 branch for rebase and submit but instead locate the branch by comparing the depot paths. name-rev may produce results like wrongbranch~12 as it uses the first match. Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
| * git-p4: Cleanup, make listExistingP4Branches a global function for later use.Simon Hausmann2007-07-18
| | | | | | | | | | Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
| * git-p4: input to "p4 files" by stdin instead of argumentsScott Lamb2007-07-17
| | | | | | | | | | | | | | | | | | This approach, suggested by Alex Riesen, bypasses the need for xargs-style argument list handling. The handling in question looks broken in a corner case with SC_ARG_MAX=4096 and final argument over 96 characters. Signed-off-by: Scott Lamb <slamb@slamb.org> Signed-off-by: Simon Hausmann <simon@lst.de>
| * git-p4: use subprocess in p4CmdListScott Lamb2007-07-17
| | | | | | | | | | | | | | | | This allows bidirectional piping - useful for "-x -" to avoid commandline arguments - and is a step toward bypassing the shell. Signed-off-by: Scott Lamb <slamb@slamb.org> Signed-off-by: Simon Hausmann <simon@lst.de>
* | contrib/emacs/Makefile: Also install .el files.David Kastrup2007-07-15
| | | | | | | | | | Signed-off-by: David Kastrup <dak@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Demote git-p4import to contrib status.Sean2007-07-15
|/ | | | | | | | | Move git-p4import.py and Documentation/git-p4import.txt into a contrib/p4import directory. Add a README there directing people to contrib/fast-import/git-p4 as a better alternative. Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Use $(RM) in Makefiles instead of 'rm -f'Emil Medve2007-07-14
| | | | | Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'master' of git://repo.or.cz/git/fastimportJunio C Hamano2007-07-14
|\ | | | | | | | | | | | | * 'master' of git://repo.or.cz/git/fastimport: Teach fast-import to recursively copy files/directories Fix git-p4 on Windows to not use the Posix sysconf function. Correct trivial typo in fast-import documentation
| * Fix git-p4 on Windows to not use the Posix sysconf function.Marius Storm-Olsen2007-07-14
| | | | | | | | | | | | | | | | | | | | Add condition for Windows, since it doesn't support the os.sysconf module. We hardcode the commandline limit to 2K, as that should work on most Windows platforms. Signed-off-by: Marius Storm-Olsen <marius@trolltech.com> Acked-by: Simon Hausmann <simon@lst.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Add contrib/stats/mailmap.pl scriptJunio C Hamano2007-07-14
| | | | | | | | | | | | | | | | | | This script reads the existing commit log and .mailmap file, and outputs author e-mail addresses that would map to more than one names (most likely due to difference in the way they are spelled, but some are due to ancient botched commits). Signed-off-by: Junio C Hamano <gitster@pobox.com>