From: Wincent Colaiuta <win@wincent.com>
To: merlyn@stonehenge.com (Randal L. Schwartz)
Cc: git@vger.kernel.org
Subject: Re: I want "fast forward my workdir to upstream if it's safe"
Date: Fri, 8 May 2009 01:18:32 +0200 [thread overview]
Message-ID: <FC9BF880-D69F-4A56-B9FA-EF5BDBF73437@wincent.com> (raw)
In-Reply-To: <86prekfv7z.fsf@blue.stonehenge.com>
El 7/5/2009, a las 23:40, Randal L. Schwartz escribió:
> For the past few years, within any given 12 hour period, at least
> one person on #git would come up with the use case with which I'm
> really familiar (having needed it many times myself):
>
> I have a workdir tracking a remote.
> I may or may not have made local edits... I can't remember.
> I may or may not have made local commits... I can't remember.
> But the upstream might now have changed... please update me *safely*.
>
> Seriously, this comes up, a lot. Typically, from a cron job updater,
> but often just "what can I do to make sure I'm up to date".
>
> So, what I need is a command, likely an option to "git merge" that
> says "do
> everything that a git merge would do except abort if it would have
> been a
> merge commit". In other words, abort if the workdir is dirty or is
> not a
> fast-forward update to the upstream. Bonus if it exits non-zero if
> something went wrong.
>
> Please don't tell me "use these three commands in this script".
> I want a *command* I can tell people in #git.
"git status"?
# On branch master
# Your branch is ahead of 'origin/master' by 46 commits.
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: foo
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# bar
next prev parent reply other threads:[~2009-05-07 23:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-07 21:40 I want "fast forward my workdir to upstream if it's safe" Randal L. Schwartz
2009-05-07 23:18 ` Wincent Colaiuta [this message]
2009-05-07 23:20 ` Randal L. Schwartz
2009-05-08 2:30 ` Jeff King
2009-05-08 6:53 ` Andreas Ericsson
2009-05-08 7:01 ` Jeff King
2009-05-08 12:34 ` Eyvind Bernhardsen
2009-05-08 14:02 ` Randal L. Schwartz
2009-05-08 15:57 ` Junio C Hamano
2009-05-08 16:15 ` Jakub Narebski
2009-05-11 20:11 ` Eyvind Bernhardsen
2009-05-08 21:34 ` Miles Bader
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=FC9BF880-D69F-4A56-B9FA-EF5BDBF73437@wincent.com \
--to=win@wincent.com \
--cc=git@vger.kernel.org \
--cc=merlyn@stonehenge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).