Commit Graph

27 Commits (30becc2d1a7607d09b0998ead97914a1bc193ac1)

Author SHA1 Message Date
mhm@chromium.org 7a09961f47 Reland again Msysgit Support for gcl and git-cl.
EDITOR environment variable shouldn't be required anymore
can contain quotes and multiple arguments.

Uses shell=True to let the shell parse the quoted string
instead of handling all forms of quotes ourselves. 

By default, msysgit ships with the TERM environment variable
set, when set to 'msys', we prepend 'env' to the executed
command. That is required so msys knows which program
to run the given file.

BUG=none
TEST=On many platforms. Win7, WinXP, Ubuntu.
Review URL: http://codereview.chromium.org/6685062

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78332 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 5ac2101164 This change moves the code I added to git-cl to parse the results of the presubmit hooks into presubmit_support itself. It also removes a lot of the text-file parsing that is no longer necessary since everything is in process.
It also simplifies all of the PresubmitResult* objects and the way we're using output streams since we can assume more about how the callers are calling us.

Note that I uses PEP-8 style method names where I was adding entirely new classes (or rewriting existing classes completely) since per maruel@ he is trying to new that style for new code.

This change also contains two small changes to git_cl to fix bugs and restore the previous behavior of --force skipping the presubmit checks.

Review URL: http://codereview.chromium.org/6694009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78328 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org dc276cba14 minor cleanup w/ chases's feedback from CL 6665018.
http://codereview.chromium.org/6665018/

Review URL: http://codereview.chromium.org/6686060

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78098 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
thomasvl@chromium.org 68f2746262 Better revert
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6690012

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78029 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
thomasvl@chromium.org ca7953a5e8 Revert part of 77946 and 77978 so things work against when EDITOR is set to
something with spaces in it.

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6686046

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78027 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 5a2fefb9eb Fix prompting - had the logic backwards. The git-cl unit tests actually test the prompting correctly (once they are modified to pass otherwise).
Review URL: http://codereview.chromium.org/6679032

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77985 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
mhm@chromium.org 3e48aa74c0 Reland Usage of TERM to distinguish between msys and cygwin.
BUG=70548
TEST=check $TERM in windows
Review URL: http://codereview.chromium.org/6683035

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77978 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
jam@chromium.org 7888d9796b Revert 77954 - Use TERM to distinguish between console and msysgit.
It is cleaner this way since in Win32 console, the
value is always "dumb" while in msysgit it is always
"msys" The user shouldn't change the value of $TERM
in msysgit otherwise their whole copy of msysgit
will be flaky.

BUG=70548
TEST=check $TERM in windows

Review URL: http://codereview.chromium.org/6686027

TBR=mhm@chromium.org
Review URL: http://codereview.chromium.org/6683033

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77972 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
mhm@chromium.org eceda5af1e Use TERM to distinguish between console and msysgit.
It is cleaner this way since in Win32 console, the
value is always "dumb" while in msysgit it is always
"msys" The user shouldn't change the value of $TERM
in msysgit otherwise their whole copy of msysgit
will be flaky.

BUG=70548
TEST=check $TERM in windows

Review URL: http://codereview.chromium.org/6686027

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77954 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
mhm@chromium.org d161d848cf Reland - Support msysgit in gcl and git-cl
An explicit msysgit check is needed since it requires
the usage of 'env' to open the editor.

BUG=70550, 70548
TEST=Win,Linux 
Review URL: http://codereview.chromium.org/6680019

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77946 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
jam@chromium.org 93efa03156 Revert 77913 - Regression: Editor Linux Fix for gcl.
Editor doesn't come up due to Shell=True

BUG=none
TEST=linux and win works
Review URL: http://codereview.chromium.org/6679023

TBR=mhm@chromium.org
Review URL: http://codereview.chromium.org/6684022

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77928 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 37248c0bba fix prompting if there were errors in the hooks. Still need to write unit tests.
TBR=maruel@chromium.org

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77922 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
mhm@chromium.org 3843692019 Regression: Editor Linux Fix for gcl.
Editor doesn't come up due to Shell=True

BUG=none
TEST=linux and win works
Review URL: http://codereview.chromium.org/6679023

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77913 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
mhm@chromium.org 3d4d7edc3d msysgit - Fix issue where git cl doesn't recognize editor.
The unix editor doesn't popup resulting in a unsuccessful upload. This change successfully fixes it.

BUG=70550
TEST=git cl upload works as expected under msysgit.
Review URL: http://codereview.chromium.org/6679019

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77910 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 970c522f0f Make git-cl work with OWNERS file hooks properly.
This version calls into presubmit_support directly to support the OWNERS hooks. We do not need both this patch and http://codereview.chromium.org/6646009/

This patch depends on http://codereview.chromium.org/6665018/ .

Review URL: http://codereview.chromium.org/6674014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77898 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
dpranke@chromium.org 23beb9e0a3 Remove support for generic "hook files" in git-cl, and just call into
the git_cl_hooks library in depot_tools. Also remove support for
post-commit hooks. This binds git-cl tighter to depot_tools, but also
makes things a lot simpler and cleaner.

Review URL: http://codereview.chromium.org/6665018

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77889 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
bauerb@chromium.org b4a75c4cd4 Use reset --soft to squash before dcomitting.
Using reset --soft doesn't require touching the working copy, so it should be faster and not require rebuilds.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6575031

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77267 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org b92e4804a8 Set cwd to the root of the git checkout when running git svn info.
URL value is dependent on the local directory. The current directory would
affect Base URL on Rietveld otherwise.

Do not use Repository Root instead of URL since git svn clone foo -T bar
wouldn't be correctly based.

Update RunCommand() to be able to pass cwd argument.

TEST=git cl upload is broken if I break this code.
BUG=none

Review URL: http://codereview.chromium.org/6591093

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76791 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
bauerb@chromium.org ade368c40d Add configuration option for upstream branch and improve guessing the svn branch.
The svn branch heuristic does roughly the same thing git-svn does: We first iterate backwards over the history to find the svn URL (like svn://svn.chromium.org/chrome/trunk/src). Then we go through all defined svn-remote section looking for one where the URL is the root of the svn URL (svn://svn.chromium.org/chrome in that case), and the fetch spec looks like "trunk/src:remotes/origin/trunk". If the base URL + left part (trunk/src) is the full URL, the right part (remotes/origin/trunk) is the git ref that is updated when we do a `git svn fetch`! This works for git-svn branches that fetch from trunk as well as milestone branches.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6597004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76364 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org b2a7c3358f Add support for git cl upload --cc foo@example.com
It is useful sometimes to cc someone without marking this person as a reviewer.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/6575036

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@76093 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
chase@chromium.org f340d1d6a7 Only set --cc when it's the first upload.
BUG=none
TEST=second git-cl upload of a CL doesn't set CC again
Review URL: http://codereview.chromium.org/6546042

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@75531 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
msb@chromium.org bf1a7ba957 Update git_cl to look at right Tree Status URL for Chromium OS.
Improves output of git cl tree to use Chromium OS status, not Chromium Status.

BUG=chromium-os:11449
TEST=Output of 'git cl tree' for Chromium OS includes output from Chromium OS instead of from Chromium.

Review URL: http://codereview.chromium.org/6312047

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@73292 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
thakis@chromium.org cde3bb69d2 Tweak an informative message that has mislead at least 3 people so far.
Review URL: http://codereview.chromium.org/6331008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@71893 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org df947ea846 Improve parsing of committed hash to be more resilient.
TEST=Verified that if this code breaks, the presubmit checks fail.
BUG=none

Review URL: http://codereview.chromium.org/6079003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@71229 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 0ba7f967e1 Add support for post-dcommit/post-push hooks.
Patch contributed by sadrul@chromium.org

Review URL: http://codereview.chromium.org/5972005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@71097 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
chase@chromium.org c76e675fb5 Update the index in SendUpstream before tree check.
BUG=none
TEST=git cl dcommit/push performs an index update before
checking if the tree is dirty
Review URL: http://codereview.chromium.org/6172003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@70908 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
chase@chromium.org cc51cd03e0 Move git-cl into depot_tools.
BUG=none
TEST=git-cl works after move
Review URL: http://codereview.chromium.org/5012006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@70011 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago