Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Issue 609002: Make git-cl wrapper print errors instead of silently deleting repos.... (Closed)

Created:
10 years, 10 months ago by Daniel Erat
Modified:
9 years, 7 months ago
Reviewers:
Evan Martin, M-A Ruel
CC:
chromium-reviews, Mandeep Singh Baines
Visibility:
Public.

Description

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. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=39099

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -1 line) Patch
M git-cl View 2 chunks +13 lines, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
Daniel Erat
10 years, 10 months ago (2010-02-16 16:32:27 UTC) #1
Evan Martin
LGTM
10 years, 10 months ago (2010-02-16 16:33:36 UTC) #2
M-A Ruel
lgtm
10 years, 10 months ago (2010-02-16 16:56:45 UTC) #3
msb
10 years, 10 months ago (2010-02-16 17:48:12 UTC) #4
LGTM

On Tue, Feb 16, 2010 at 8:32 AM, <derat@chromium.org> wrote:

> Reviewers: Evan Martin,
>
> Description:
> 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.
>
> Please review this at http://codereview.chromium.org/609002
>
> SVN Base: http://src.chromium.org/svn/trunk/tools/depot_tools/
>
> Affected files:
>  M     git-cl
>
>
> Index: git-cl
> ===================================================================
> --- git-cl      (revision 39096)
> +++ git-cl      (working copy)
> @@ -1,5 +1,5 @@
>  #!/bin/sh
> -# Copyright (c) 2009 The Chromium Authors. All rights reserved.
> +# Copyright (c) 2010 The Chromium Authors. All rights reserved.
>  # Use of this source code is governed by a BSD-style license that can be
>  # found in the LICENSE file.
>
> @@ -8,7 +8,19 @@
>  cur_url=$(git config -f "$base_dir/git-cl-repo/.git/config"
> remote.origin.url)
>
>  if [ "$cur_url" != "$url" ]; then
> +  cat <<EOF
> +$base_dir/git-cl-repo
> +is tracking a non-default remote repository:
> +
> +  default: $url
> +  yours:   $cur_url
> +
> +This is intended to be an automatically-updating, read-only repository.
> +Please create a separate repository for making changes to git-cl, move
> your
> +modifications there, and then run:
>   rm -rf $base_dir/git-cl-repo
> +EOF
> +  exit 1
>  fi
>
>  if [ ! -f "$base_dir/git-cl-repo/git-cl" ]; then
>
>
>

Powered by Google App Engine
This is Rietveld 408576698