Commit Graph

32 Commits (c4e7c8717cbd057339731e8b629c2e29fcba9c42)

Author SHA1 Message Date
John Stiles 11f4a84bb1 Add quotes around paths in bash scripts.
This allows git-cl to run successfully when the depot tools are installed to a path with a space in it.

Change-Id: I79fa44d13f89fb0ee1baaa90961b4c4284913c40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2125626
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
mmoss@chromium.org 375765c6bf Generalize python_git_runner for use in non-git scripts.
Retrying the change in https://codereview.chromium.org/1415993003/, with
fixes to properly handle being called with either Windows- or
POSIX-style paths (the previous attempt assumed it was always called
with POSIX-style paths under MSYS, which itself was attempting to fix
the assumption that it was always called with Windows-style paths, but
neither assumption was right).

This change doesn't actually use the wrapper in any new places, but
subsequent changes will be made to use it in places where
'exec python' is called directly, like gclient and fetch.

BUG=411518
R=iannucci@google.com, sky@google.com

Review URL: https://codereview.chromium.org/1411793006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297401 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
akuegel@chromium.org 50289c267b Revert of Generalize python_git_runner for use in non-git scripts. (patchset #1 id:1 of https://codereview.chromium.org/1415993003/ )
Reason for revert:
Speculative revert in case this caused the bots to fail bot_update.

Original issue's description:
> Generalize python_git_runner for use in non-git scripts.
> 
> Also fixes an msys (git-bash) incompatibility, similar to the one
> fixed in crrev.com/4845f0ed694ff071da5f6ee937a0bce2ea4e6fd2.
> 
> This change doesn't actually use the wrapper in any new places, but
> subsequent changes will be made to use it in places where
> 'exec python' is called directly, like gclient and fetch.
> 
> BUG=411518
> R=iannucci@google.com
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=297357

TBR=iannucci@google.com,iannucci@chromium.org,mmoss@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=411518

Review URL: https://codereview.chromium.org/1414923008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297358 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
mmoss@chromium.org 3811235942 Generalize python_git_runner for use in non-git scripts.
Also fixes an msys (git-bash) incompatibility, similar to the one
fixed in crrev.com/4845f0ed694ff071da5f6ee937a0bce2ea4e6fd2.

This change doesn't actually use the wrapper in any new places, but
subsequent changes will be made to use it in places where
'exec python' is called directly, like gclient and fetch.

BUG=411518
R=iannucci@google.com

Review URL: https://codereview.chromium.org/1415993003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297357 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
agable@chromium.org 4f52c9e114 Remove useless comments from git bash wrappers.
R=iannucci@chromium.org

Review URL: https://codereview.chromium.org/621783002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292379 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
r.c.ladan@gmail.com ec238db2ad Invoke the bash shell via /usr/bin/env so that these scripts run on operating systems without /bin/bash too.
TEST=run "git cl owners" on FreeBSD
BUG=

Review URL: https://codereview.chromium.org/197213008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@274320 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org f52a6053e6 Refactor the way that git executables are launched in depot tools.
This introduces python_git_runner.sh, and makes git-cl, git-cache, git-number,
and git-try use it.

R=agable@chromium.org, szager@chromium.org
BUG=261738

Review URL: https://codereview.chromium.org/188383002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@256131 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
maruel@chromium.org 22879a7809 Fix git-cl quoting, yet again.
Using "%@" will correctly requote quoted arguments. Tested with repro case.
The fix in r232184 missed the necessary argument quoting.

R=iannucci@chromium.org
BUG=314192
BUG=241769

Review URL: https://codereview.chromium.org/47873010

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@232501 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
maruel@chromium.org 4f4e76fce5 Reapply 231888 "Fixes for python 2.7.5 support." with fixes.
Tested to work now with the repro case of bug 313552.

"/c" was interpreted by cygwin's bash as a path and was replaced with c:/. :(
Using //c seems to be passed through properly.
There is probably other escaping problem but this should be good enough at
this stage.

Ref: http://www.mingw.org/wiki/Posix_path_conversion

R=iannucci@chromium.org
BUG=241769
BUG=313552

Review URL: https://codereview.chromium.org/50143013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@232184 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
maruel@chromium.org 7b6847f486 Revert r231888 "Fixes for python 2.7.5 support."
This broke git cl patch due to escaping. I tried removing the double quotes but
it didn't work out. Reverting in the meantime to unblock people until I figure
out a permanent way.

BUG=313552,241769
TBR=iannucci

Review URL: https://codereview.chromium.org/50293009

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@232112 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
maruel@chromium.org b58876718d Fixes for python 2.7.5 support.
Fix the git-* wrapper scripts, PRESUBMIT.py and .gitignore.

The previous python wrapping scripts assumed python_bin\python.exe. This CL
modifies the wrapping scripts to use python.bat. This requires some quoting
magic and explicitly defer to cmd.exe.

This may break some cases where double quotes are used as arguments. We can't do
miracles on Windows.

R=iannucci@chromium.org
BUG=

Review URL: https://codereview.chromium.org/50563008

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@231888 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@google.com ed9a0ecb4f Fix dirname logic for msys and not-msys.
TBR=maruel@chromium.org
Review URL: https://codereview.chromium.org/11364105

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@166284 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org 42905bfa36 Revert r166268 "In msys-git-1.7.4, in git-cl $0 is:"
/usr/local/google/home/gspencer/depot/depot_tools/git-cl: line 22:
/usr/local/google/home/gspencer/depot/depot_tools/git-cl/git_cl.py: Not a directory
/usr/local/google/home/gspencer/depot/depot_tools/git-cl: line 22: exec:
/usr/local/google/home/gspencer/depot/depot_tools/git-cl/git_cl.py: cannot execute: Not a directory

TBR=szager@chromium.org
BUG=


Review URL: https://chromiumcodereview.appspot.com/11366117

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@166274 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
szager@google.com 3598b513fb In msys-git-1.7.4, in git-cl $0 is:
C:\depot_tools\/git-cl

But in msys-git-1.8.0 it's:

C:\depot_tools\\git-cl

Handle either syntax correctly.

TBR=maruel@chromium.org
Review URL: https://codereview.chromium.org/11359074

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@166268 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org 31919aefae Do not auto-update git-cl anymore.
The major use case was for ChromiumOS devs who were using repo. It's not a
frequent use case anymore. Having git-cl sync on each invocation is costly.

TBR=nsylvain@chromium.org
BUG=
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@121834 0039d316-1c4b-4281-b951-d872f2087c98
13 years ago
maruel@chromium.org 3abe79b9f4 Enable PYTHONDONTWRITEBYTECODE=1 as much as possible.
Since we clobber the .pyc, it's not useful to generate them in the first place.

R=dpranke@chromium.org
BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@103066 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
cmp@chromium.org 4c6e404cf9 Make git-cl and update_depot_tools msys-compatible.
This change makes it possible to run 'git cl' from
a Command Prompt using only the auto-installed git
from depot_tools.  It is needed because in MSysGit,
'git cl' invokes 'git' which calls 'git-cl'.  While
'git-cl' is pulled from depot_tools (since it's in
PATH), depot_tools/python_bin is not in PATH, and
so we execute git_cl.py through our auto-installed
python.exe directly.

update_depot_tools is fixed so that if we find
the auto-installed svn and git in depot_tools, we
execute those directly, otherwise falling back to
calling them based on PATH.

In both git-cl and update_depot_tools, we only enable
this new behavior if uname in PATH reports a 'MINGW'
environment.  This should not trigger on any other
environment where uname exists, including Cygwin which
should report 'CYGWIN'.
Review URL: http://codereview.chromium.org/7020035

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87510 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
nsylvain@chromium.org f9328b9b72 Revert 86501: Make git-cl and update_depot_tools msys-compatible.
Review URL: http://codereview.chromium.org/7008006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@86552 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
cmp@chromium.org 6dbde57841 Make git-cl and update_depot_tools msys-compatible.
Review URL: http://codereview.chromium.org/7055025

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@86501 0039d316-1c4b-4281-b951-d872f2087c98
14 years ago
maruel@chromium.org 2a74d37e28 Move git_cl back into depot_tools.
Remove git_cl_hooks.py since it's now unnecessary.

BUG=
TEST=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@79715 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
msb@chromium.org 2a94904744 Isolate depot_tools update into a separate script.
Also, modify git-cl to also update depot_tools. Otherwise, the git-cl
script never gets updated for folks that only use git-cl but
not gclient. This fixes a bug ChromiumOS developers are currently seeing
where there git-cl checkout is still pointing to src.chromium.org
and not git.chromium.org.

BUG=none
TEST=Verified that git-cl help and gclient help work.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@62948 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
maruel@chromium.org 37801da395 Change git-cl wrapper script to automatically fix the git_cl_repo remote url.
This is nicer than an error message.

TEST=manually tested the url was overwritten
BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@62923 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
chase@chromium.org 733bc0fa18 Update git-cl to use git.chromium.org.
BUG=none
TEST=git-cl works
TBR=nsylvain@chromium.org
Review URL: http://codereview.chromium.org/3757006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@62916 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org b48f2298b2 git-cl: change the git-cl-repo dir to git_cl_repo so that we can import
python does not seem to be able to import for a dir with dashes in it.

BUG=none
TEST=Ran git-cl help and verified it worked and new dir was created.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@61694 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org d065eccd01 gclient: update git-cl whenever git-cl is run and not when gclient is run
Rather than updating git-cl whenever gclient is invoked, update it
whenever git-cl is invoked.

In the chromium-os workflow, folks often run git-cl but rarely run gclient.
This results in folks running an older git-cl which may not
have the latest features/fixes.

TEST=

Tested that git-cl is updated when it is stale, git-cl is cloned when it doesn't exist and is not updated when DEPOT_TOOLS_UPDATE=0

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@52236 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
derat@chromium.org e08f491731 depot_tools: Make git-cl wrapper not fail when repo is missing.
I broke this in my last change.

TBR=msb
Review URL: http://codereview.chromium.org/627004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@39277 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
derat@chromium.org b7ec6aa923 Make git-cl wrapper print errors instead of silently deleting repos.
It would previously delete and recreate git-cl-repo if it
saw that the remote was different than expected.  This looks
like it was added for the transition from the old SVN repo
to the new git one, but it also has the effect of losing
any local changes that have been made in the repo. :-(

Everyone should be updated by now, so print a helpful error
and exit instead.
Review URL: http://codereview.chromium.org/609002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@39099 0039d316-1c4b-4281-b951-d872f2087c98
15 years ago
msb@chromium.org dffe494206 Move git-cl to src.chromium.org
Review URL: http://codereview.chromium.org/397029

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@32259 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 2534063d34 Make initial git-cl and git-try fetch quieter.
Add .gitignore for causual ignores.

TEST=none
BUG=none

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


git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@22380 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 43418e4315 Evan lied to me. The stub script needed to use "$@" and not "$*".
Otherwise, all the parameters are coagulated into a single one.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@17968 0039d316-1c4b-4281-b951-d872f2087c98
16 years ago
maruel@chromium.org 565db0efab Add git-cl and git-try stubs.
They automatically git clone the original repository and execute the original script. So if they are first in the path, they will be executed. If a user has another git-cl/try in the path prior, these stubs won't be used at all and won't mess with the user's setup.

Also fix a bug with git handling in trychange.py
Review URL: http://codereview.chromium.org/119244

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