git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Deprecate git-cherry
@ 2007-07-06 16:29 Johannes Schindelin
  2007-07-06 20:48 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2007-07-06 16:29 UTC (permalink / raw)
  To: git, gitster


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
 '

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Deprecate git-cherry
  2007-07-06 16:29 [PATCH] Deprecate git-cherry Johannes Schindelin
@ 2007-07-06 20:48 ` Junio C Hamano
  2007-07-06 21:21   ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2007-07-06 20:48 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git, gitster

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> 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.

Eh, --left-right anybody?

git-cherry is used by people's scripts, and I do not think
deprecating is an option at least in the short term.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Deprecate git-cherry
  2007-07-06 20:48 ` Junio C Hamano
@ 2007-07-06 21:21   ` Johannes Schindelin
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2007-07-06 21:21 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi,

On Fri, 6 Jul 2007, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > 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.
> 
> Eh, --left-right anybody?
> 
> git-cherry is used by people's scripts, and I do not think
> deprecating is an option at least in the short term.

Okay, I should have been more precise.

Maybe there are some interesting scripts that use "git cherry". I'd like 
to see them (which does not mean that I vote for git-cherry removal). 
Personally, I use "git rev-list --cherry-pick", because it spares me one 
call to sed.

However, I do not think that there is much value in advertising it any 
more. There is much more value in "git log --cherry-pick", since you can 
get the commit messages and the patches by just adding one more flag (and 
absent any path parameter, that can be even _at the end_ of the command 
line, making it even more convenient).

So what I meat was: advertise "git log --cherry-pick" instead of "git 
cherry", since it is vastly more useful.

There is one real consequence on my common usage, though: It annoys me 
whenever I want to cherry pick a commit, which happens quite often, that 
the bash completion completes on this (for me) useless command. I would 
like to see that gone (but only after a grace period, evidently).

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-06 21:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-06 16:29 [PATCH] Deprecate git-cherry Johannes Schindelin
2007-07-06 20:48 ` Junio C Hamano
2007-07-06 21:21   ` Johannes Schindelin

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).