aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Merge branch 'mm/mediawiki-author-fix'Junio C Hamano2011-10-26
|\ | | | | | | | | * mm/mediawiki-author-fix: git-remote-mediawiki: don't include HTTP login/password in author
| * git-remote-mediawiki: don't include HTTP login/password in authorMatthieu Moy2011-10-20
| | | | | | | | | | | | | | | | | | | | On the MediaWiki side, the author information is just the MediaWiki login of the contributor. The import turns it into login@$wiki_name to create the author's email address on the wiki side. But we don't want this to include the HTTP password if it's present in the URL ... Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jn/libperl-git-config'Junio C Hamano2011-10-26
|\ \ | | | | | | | | | | | | | | | * jn/libperl-git-config: Add simple test for Git::config_path() in t/t9700-perl-git.sh libperl-git: refactor Git::config_*
| * | Add simple test for Git::config_path() in t/t9700-perl-git.shJakub Narebski2011-10-21
| | | | | | | | | | | | | | | | | | | | | Tests "~/foo" path expansion and multiple values. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | libperl-git: refactor Git::config_*Junio C Hamano2011-10-18
| | | | | | | | | | | | | | | | | | | | | Move common parts of Git::config(), Git::config_bool(), Git::config_int() and Git::config_path() into _config_common() helper. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jm/maint-gitweb-filter-forks-fix'Junio C Hamano2011-10-26
|\ \ \ | | | | | | | | | | | | | | | | * jm/maint-gitweb-filter-forks-fix: gitweb: fix regression when filtering out forks
| * | | gitweb: fix regression when filtering out forksJulien Muchembled2011-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a condition in filter_forks_from_projects_list that failed if process directory was different from project root: in such case, the subroutine was a no-op and forks were not detected. Signed-off-by: Julien Muchembled <jm@jmuchemb.eu> Tested-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'cn/fetch-prune'Junio C Hamano2011-10-26
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cn/fetch-prune: fetch: treat --tags like refs/tags/*:refs/tags/* when pruning fetch: honor the user-provided refspecs when pruning refs remote: separate out the remote_find_tracking logic into query_refspecs t5510: add tests for fetch --prune fetch: free all the additional refspecs Conflicts: remote.c
| * | | | fetch: treat --tags like refs/tags/*:refs/tags/* when pruningCarlos Martín Nieto2011-10-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If --tags is specified, add that refspec to the list given to prune_refs so it knows to treat it as a filter on what refs to should consider for prunning. This way git fetch --prune --tags origin only prunes tags and doesn't delete the branch refs. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | fetch: honor the user-provided refspecs when pruning refsCarlos Martín Nieto2011-10-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user gave us refspecs on the command line, we should use those when deciding whether to prune a ref instead of relying on the refspecs in the config. Previously, running git fetch --prune origin refs/heads/master:refs/remotes/origin/master would delete every other ref under the origin namespace because we were using the refspec to filter the available refs but using the configured refspec to figure out if a ref had been deleted on the remote. This is clearly the wrong thing to do. Change prune_refs and get_stale_heads to simply accept a list of references and a list of refspecs. The caller of either function needs to decide what refspecs should be used to decide whether a ref is stale. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | remote: separate out the remote_find_tracking logic into query_refspecsCarlos Martín Nieto2011-10-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the body of remote_find_tracking() to a new helper query_refspecs() that finds a refspec that matches and applies the transformation, but explicitly takes the list of refspecs, and make remote_find_tracking() a thin wrapper of it. Make apply_refspecs() also use query_refspecs(). Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | t5510: add tests for fetch --pruneCarlos Martín Nieto2011-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The failures will be fixed in later commits. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | fetch: free all the additional refspecsCarlos Martín Nieto2011-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'maint'Junio C Hamano2011-10-23
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * maint: Reindent closing bracket using tab instead of spaces
| * \ \ \ \ Merge branch 'maint-1.7.3' into maintJunio C Hamano2011-10-23
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint-1.7.3: Reindent closing bracket using tab instead of spaces
| | * | | | | Reindent closing bracket using tab instead of spacesNguyễn Thái Ngọc Duy2011-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'maint'Junio C Hamano2011-10-23
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: Git 1.7.7.1 RelNotes/1.7.7.1: setgid bit patch is about fixing "git init" via Makefile setting Conflicts: GIT-VERSION-GEN
| * | | | | | Git 1.7.7.1v1.7.7.1Junio C Hamano2011-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | RelNotes/1.7.7.1: setgid bit patch is about fixing "git init" via Makefile ↵Jonathan Nieder2011-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setting The change was actually about "git init -s" which sets the setgid bit on SysV-style systems to allow shared access to a repository, and can provoke errors on BSD-style systems, depending on how permissive the filesystem in use wants to be. More to the point, the patch was just taking a fix that arrived for FreeBSD in v1.5.5 days and making it also apply to machines using an (obscure) GNU userland/FreeBSD kernel mixture. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Update draft release notes to 1.7.8Junio C Hamano2011-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'po/insn-editor'Junio C Hamano2011-10-21
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * po/insn-editor: "rebase -i": support special-purpose editor to edit insn sheet
| * | | | | | | "rebase -i": support special-purpose editor to edit insn sheetPeter Oberndorfer2011-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The insn sheet used by "rebase -i" is designed to be easily editable by any text editor, but an editor that is specifically meant for it (but is otherwise unsuitable for editing regular text files) could be useful by allowing drag & drop reordering in a GUI environment, for example. The GIT_SEQUENCE_EDITOR environment variable and/or the sequence.editor configuration variable can be used to specify such an editor, while allowing the usual editor to be used to edit commit log messages. As usual, the environment variable takes precedence over the configuration variable. It is envisioned that other "sequencer" based tools will use the same mechanism. Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'jc/broken-ref-dwim-fix'Junio C Hamano2011-10-21
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/broken-ref-dwim-fix: resolve_ref(): report breakage to the caller without warning resolve_ref(): expose REF_ISBROKEN flag refs.c: move dwim_ref()/dwim_log() from sha1_name.c
| * | | | | | | | resolve_ref(): report breakage to the caller without warningJunio C Hamano2011-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 629cd3a (resolve_ref(): emit warnings for improperly-formatted references, 2011-09-15) made resolve_ref() warn against files that are found in the directories the ref dwimmery looks at. The intent may be good, but these messages come from a wrong level of the API hierarchy. Instead record the breakage in "flags" whose purpose is to explain the result of the function to the caller, who is in a much better position to make intelligent decision based on the information. This updates sha1_name.c::dwim_ref() to warn against such a broken candidate only when it does not appear directly below $GIT_DIR to restore the traditional behaviour, as we know many files directly underneath $GIT_DIR/ are not refs. Warning against "git show config --" with "$GIT_DIR/config does not look like a well-formed ref" does not make sense, and we may later tweak the dwimmery not to even consider them as candidates, but that is a longer term topic. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | resolve_ref(): expose REF_ISBROKEN flagJunio C Hamano2011-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of keeping this as an internal API, let the callers find out the reason why resolve_ref() returned NULL is not because there was no such file in $GIT_DIR but because a file was corrupt. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | refs.c: move dwim_ref()/dwim_log() from sha1_name.cJunio C Hamano2011-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both dwim_ref()/dwim_log() functions are intimately related to the ref parsing rules defined in refs.c and better fits there. Move them together with substitute_branch_name(), a file scope static helper function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Merge branch 'mh/ref-api'Junio C Hamano2011-10-21
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mh/ref-api: clear_ref_cache(): inline function write_ref_sha1(): only invalidate the loose ref cache clear_ref_cache(): extract two new functions clear_ref_cache(): rename parameter invalidate_ref_cache(): expose this function in the refs API invalidate_ref_cache(): take the submodule as parameter invalidate_ref_cache(): rename function from invalidate_cached_refs()
| * | | | | | | | | clear_ref_cache(): inline functionMichael Haggerty2011-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clear_ref_cache() was only called from one place, so inline it there. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | write_ref_sha1(): only invalidate the loose ref cacheMichael Haggerty2011-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since write_ref_sha1() can only write loose refs and cannot write symbolic refs, there is no need for it to invalidate the packed ref cache. Suggested by: Martin Fick <mfick@codeaurora.org> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | clear_ref_cache(): extract two new functionsMichael Haggerty2011-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract two new functions from clear_cached_refs(): clear_loose_ref_cache() and clear_packed_ref_cache(). Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | clear_ref_cache(): rename parameterMichael Haggerty2011-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...for consistency with the rest of this module. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | invalidate_ref_cache(): expose this function in the refs APIMichael Haggerty2011-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make invalidate_ref_cache() an official part of the refs API. It is currently a fact of life that code outside of refs.c mucks about with references. This change gives such code a way of informing the refs module that it should no longer trust its cache. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | invalidate_ref_cache(): take the submodule as parameterMichael Haggerty2011-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of invalidating the ref cache on an all-or-nothing basis, invalidate the cache for a specific submodule. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | invalidate_ref_cache(): rename function from invalidate_cached_refs()Michael Haggerty2011-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is the cache that is being invalidated, not the references, and the new name makes this unambiguous. Rename other items analogously: * struct cached_refs -> struct ref_cache * cached_refs (the variable) -> ref_cache * clear_cached_refs() -> clear_ref_cache() * create_cached_refs() -> create_ref_cache() * get_cached_refs() -> get_ref_cache() Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | Merge branch 'jc/match-refs-clarify'Junio C Hamano2011-10-21
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/match-refs-clarify: rename "match_refs()" to "match_push_refs()" send-pack: typofix error message
| * | | | | | | | | | rename "match_refs()" to "match_push_refs()"Junio C Hamano2011-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Yes, there is a warning that says the function is only used by push in big red letters in front of this function, but it didn't say a more important thing it should have said: what the function is for and what it does. Rename it and document it to avoid future confusion. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | send-pack: typofix error messageJunio C Hamano2011-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The message identifies the process as receive-pack when it cannot fork the sideband demultiplexer. We are actually a send-pack. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | | Merge branch 'jc/make-tags'Junio C Hamano2011-10-21
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/make-tags: Makefile: ask "ls-files" to list source files if available
| * | | | | | | | | | | Makefile: ask "ls-files" to list source files if availableJunio C Hamano2011-10-18
| | |_|_|_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The [ce]tags and cscope targets used to run "find" looking for any paths that match '*.[chS]' to feed the list of source files to downstream xargs. Use "git ls-files" if it is already available to us, and otherwise use a tighter "find" expression that does not list directories and does not go into our .git directory. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | | Merge branch 'ss/inet-ntop'Junio C Hamano2011-10-21
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ss/inet-ntop: inet_ntop.c: Work around GCC 4.6's detection of uninitialized variables
| * | | | | | | | | | | inet_ntop.c: Work around GCC 4.6's detection of uninitialized variablesSebastian Schuberth2011-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 4.6 claims that error: 'best.len' may be used uninitialized in this function so silence that warning which is treated as an error by also initializing the "len" members of the struct. Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | | | Merge branch 'jc/maint-remove-renamed-ref'Junio C Hamano2011-10-21
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/maint-remove-renamed-ref: branch -m/-M: remove undocumented RENAMED-REF Conflicts: refs.c
| * | | | | | | | | | | | branch -m/-M: remove undocumented RENAMED-REFJunio C Hamano2011-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit message for c976d41 (git-branch: add options and tests for branch renaming, 2006-11-28) mentions RENAME_REF but otherwise this is not documented anywhere, and it does not appear in any of the tests. Worse yet, the name of the actual file is "RENAMED-REF". This was supposed to hold the commit object name at the tip of the branch the most recent "branch -m/-M" renamed, but that is not necessary in order to be able to recover from a mistake. Even when "branch -M A B" overwrites an existing branch B, what is kept in RENAMED-REF is the commit at the tip of the original branch A, not the commit B from the now-lost branch. Just remove this unused "feature". Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | | | | Merge branch 'pw/p4-update'Junio C Hamano2011-10-21
|\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pw/p4-update: git-p4: handle files with shell metacharacters git-p4: keyword flattening fixes git-p4: stop ignoring apple filetype git-p4: recognize all p4 filetypes git-p4: handle utf16 filetype properly git-p4 tests: refactor and cleanup
| * | | | | | | | | | | | | git-p4: handle files with shell metacharactersLuke Diamand2011-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-p4 used to simply pass strings into system() and popen(), and relied on the shell doing the necessary expansion. This though meant that shell metacharacters in file names would be corrupted - for example files with $ or space in them. Switch to using subprocess.Popen() and friends, and pass in explicit arrays in the places where it matters. This then avoids needing shell expansion. Add trivial helper functions for some common perforce operations. Add test case. [pw: test cleanup] Signed-off-by: Luke Diamand <luke@diamand.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | | | | git-p4: keyword flattening fixesPete Wyckoff2011-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Join the text before looking for keywords. There is nothing to prevent the p4 output marshaller from splitting in the middle of a keyword, although it has never been known to happen. Also remove the (?i) regexp modifier; perforce keywords are documented as case-sensitive. Remove the "\n" end-character match. I don't know why that is in there, and every keyword in a fairly large production p4 repository always ends with a $. Acked-by: Luke Diamand <luke@diamand.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | | | | git-p4: stop ignoring apple filetypePete Wyckoff2011-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently "apple" filetype is ignored explicitly, and the file is not even included in the git repository. This seems wrong. Remove this, letting it be treated like a "binary" filetype. Acked-by: Luke Diamand <luke@diamand.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | | | | git-p4: recognize all p4 filetypesPete Wyckoff2011-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous code was approximate in the filetypes it recognized. Put in the canonical list and be more careful about matching elements of the file type. This might change behavior in some cases, hopefully for the better. Windows newline mangling will now happen on all text files. Previously some like "text+ko" were oddly exempt. Files with multiple combinations of modifiers, like "text+klx", are now recognized for keyword expansion. I expect these to be seen only rarely. Acked-by: Luke Diamand <luke@diamand.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | | | | git-p4: handle utf16 filetype properlyPete Wyckoff2011-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the filetypes that p4 supports is utf16. Its behavior is odd in this case. The data delivered through "p4 -G print" is not encoded in utf16, although "p4 print -o" will produce the proper utf16-encoded file. When dealing with this filetype, discard the data from -G, and instead read the contents directly. An alternate approach would be to try to encode the data in python. That worked for true utf16 files, but for other files marked as utf16, p4 delivers mangled text in no recognizable encoding. Add a test case to check utf16 handling, and +k and +ko handling. Reported-by: Chris Li <git@chrisli.org> Acked-by: Luke Diamand <luke@diamand.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | | | | | | git-p4 tests: refactor and cleanupPete Wyckoff2011-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a library for functions that are common to multiple git-p4 test files. Be a bit more clever about starting and stopping p4d. Specify a unique port number for each test, so that tests can run in parallel. Start p4d not in daemon mode, and save the pid, to be able to kill it cleanly later. Never kill p4d at startup; always shutdown cleanly. Handle directory changes better. Always chdir inside a subshell, and remove any post-test directory changes. Clean up whitespace, and use test_cmp and test_must_fail more consistently. Separate the tests related to detecting p4 branches into their own file, and add a few more. Acked-by: Luke Diamand <luke@diamand.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>