git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: git@vger.kernel.org, gitster@pobox.com
Subject: [PATCH] Deprecate git-cherry
Date: Fri, 6 Jul 2007 17:29:57 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0707061722020.4093@racer.site> (raw)


A cleaner alternative was introduced in v1.5.2~185^2~1, which not only
allows you to list the commits, but to inspect them, too:

	git log --cherry-pick <upstream>...[<head>]

There is a functional difference, though: git cherry shows both 
directions, <upstream>...<head> and <head>...<upstream>, and prefixes
the commits with '+' and '-', respectively.

'git rev-list --cherry-pick <upstream>...[<head>]' only shows one 
direction, and does not prefix the commits.

However, in practice you are usually only interested in one direction 
anyway (as seen in the cvsexportcommit example).

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

	It might make sense to also allow "--cherry", since it is shorter 
	to type ;-)

 Documentation/core-tutorial.txt       |    4 ++--
 Documentation/git-cherry.txt          |    6 ++++++
 Documentation/git-cvsexportcommit.txt |    2 +-
 t/t3401-rebase-partial.sh             |    2 +-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Documentation/core-tutorial.txt b/Documentation/core-tutorial.txt
index 4fb6f41..accd0dc 100644
--- a/Documentation/core-tutorial.txt
+++ b/Documentation/core-tutorial.txt
@@ -1571,8 +1571,8 @@ like this:
    half of `git pull` but does not merge. The head of the
    public repository is stored in `.git/refs/remotes/origin/master`.
 
-4. Use `git cherry origin` to see which ones of your patches
-   were accepted, and/or use `git rebase origin` to port your
+4. Use `git log --cherry-pick origin...` to see which ones of your
+   patches were accepted, and/or use `git rebase origin` to port your
    unmerged changes forward to the updated upstream.
 
 5. Use `git format-patch origin` to prepare patches for e-mail
diff --git a/Documentation/git-cherry.txt b/Documentation/git-cherry.txt
index e694382..16e170f 100644
--- a/Documentation/git-cherry.txt
+++ b/Documentation/git-cherry.txt
@@ -11,6 +11,12 @@ SYNOPSIS
 
 DESCRIPTION
 -----------
+THIS COMMAND IS DEPRECATED:
+Use 'git rev-list --cherry-pick upstream...head' instead.  This will
+display the commits that would have been prefixed with '+' by
+'git cherry upstream..head'.  If you need the commits prefixed with '-',
+use 'git rev-list --cherry-pick head...upstream' instead.
+
 The changeset (or "diff") of each commit between the fork-point and <head>
 is compared against each commit between the fork-point and <upstream>.
 
diff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt
index 6c423e3..3055764 100644
--- a/Documentation/git-cvsexportcommit.txt
+++ b/Documentation/git-cvsexportcommit.txt
@@ -81,7 +81,7 @@ Merge pending patches into CVS automatically -- only if you really know what you
 ------------
 $ export GIT_DIR=~/project/.git
 $ cd ~/project_cvs_checkout
-$ git-cherry cvshead myhead | sed -n 's/^+ //p' | xargs -l1 git-cvsexportcommit -c -p -v
+$ git rev-list --cherry-pick cvshead...myhead  | xargs -l1 git-cvsexportcommit -c -p -v
 ------------
 
 Author
diff --git a/t/t3401-rebase-partial.sh b/t/t3401-rebase-partial.sh
index 4934a4e..6902737 100755
--- a/t/t3401-rebase-partial.sh
+++ b/t/t3401-rebase-partial.sh
@@ -43,7 +43,7 @@ test_expect_success \
 '
 
 test_debug \
-    'git cherry master &&
+    'git log --cherry-pick master... &&
      git format-patch -k --stdout --full-index master >/dev/null &&
      gitk --all & sleep 1
 '

             reply	other threads:[~2007-07-06 16:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-06 16:29 Johannes Schindelin [this message]
2007-07-06 20:48 ` [PATCH] Deprecate git-cherry Junio C Hamano
2007-07-06 21:21   ` Johannes Schindelin

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0707061722020.4093@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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 NNTP newsgroup(s).