public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha•warpmail.net>
To: "Bernhard R. Link" <brlink@debian•org>
Cc: git@vger•kernel.org
Subject: Re: [PATCH 1/7] add new command git equal-tree-marker
Date: Mon, 30 Nov 2009 16:36:28 +0100	[thread overview]
Message-ID: <4B13E67C.4050005@drmicha.warpmail.net> (raw)
In-Reply-To: <9e6833ef7188f41d6ea46ddcf92929af284b4adb.1259524136.git.brlink@debian.org>

Bernhard R. Link venit, vidit, dixit 30.11.2009 15:43:
> This adds a new commit denoting tha current branch has the same
> tree as another branch, thus allowing fast-forward from the named
> commits to this one.
> 
> TODO: manpage, rewrite as builtin once the semantics are accepted?
> ---
>  .gitignore               |    1 +
>  Makefile                 |    1 +
>  git-equal-tree-marker.sh |   50 ++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 52 insertions(+), 0 deletions(-)
>  create mode 100644 git-equal-tree-marker.sh
> 
> diff --git a/.gitignore b/.gitignore
> index ac02a58..248d146 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -39,6 +39,7 @@
>  /git-difftool
>  /git-difftool--helper
>  /git-describe
> +/git-equal-tree-marker
>  /git-fast-export
>  /git-fast-import
>  /git-fetch
> diff --git a/Makefile b/Makefile
> index 4dba10e..913d4c4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -336,6 +336,7 @@ TEST_PROGRAMS =
>  SCRIPT_SH += git-am.sh
>  SCRIPT_SH += git-bisect.sh
>  SCRIPT_SH += git-difftool--helper.sh
> +SCRIPT_SH += git-equal-tree-marker.sh
>  SCRIPT_SH += git-filter-branch.sh
>  SCRIPT_SH += git-lost-found.sh
>  SCRIPT_SH += git-merge-octopus.sh
> diff --git a/git-equal-tree-marker.sh b/git-equal-tree-marker.sh
> new file mode 100644
> index 0000000..403cc56
> --- /dev/null
> +++ b/git-equal-tree-marker.sh
> @@ -0,0 +1,50 @@
> +#!/bin/sh
> +#
> +# Copyright (c) 2009 Bernhard R. Link
> +#
> +# Create a new commit making HEAD parent of the arguments,
> +# which must be commits with the same tree.
> +
> +set -e
> +
> +USAGE='<head>...'
> +LONG_USAGE='Make current HEAD parent of the given heads (which need to have the same tree).'
> +SUBDIRECTORY_OK=Yes
> +OPTIONS_SPEC=
> +. git-sh-setup
> +cd_to_toplevel
> +
> +# is there really no function for this?
> +tree_of_commit() {
> +	git cat-file commit "$1" | grep '^tree ' | head -n 1 | sed -e 's/^tree //'
> +}

You mean there should be something really simple, such as:

git rev-parse "$1"^{tree}

Michael

  reply	other threads:[~2009-11-30 15:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-30 14:43 equal-tree-merges as way to make rebases fast-forward-able Bernhard R. Link
2009-11-30 14:43 ` [PATCH 1/7] add new command git equal-tree-marker Bernhard R. Link
2009-11-30 15:36   ` Michael J Gruber [this message]
2009-11-30 14:44 ` [PATCH 2/7] add option to only visit the first parent of a equal tree merge Bernhard R. Link
2009-11-30 14:44 ` [PATCH 3/7] format-patch defaults to --first-equal-tree-only Bernhard R. Link
2009-11-30 14:44 ` [PATCH 4/7] support equal tree merges in interactive rebase Bernhard R. Link
2009-11-30 14:45 ` [PATCH 5/7] make rebase -m equal tree marker aware Bernhard R. Link
2009-11-30 14:45 ` [PATCH 6/7] add support for creating equal tree markers after rebase Bernhard R. Link
2009-11-30 14:45 ` [PATCH 7/7] add support for creating equal tree markers to rebase -i Bernhard R. Link
2009-11-30 15:10 ` equal-tree-merges as way to make rebases fast-forward-able Sverre Rabbelier
2009-11-30 15:31 ` Paolo Bonzini
2009-11-30 16:22   ` Bernhard R. Link
2009-11-30 15:35 ` Michael J Gruber
2009-11-30 15:59 ` Michael J Gruber
2009-11-30 16:54   ` Bernhard R. Link
2009-11-30 17:19 ` Johannes Schindelin
2009-11-30 18:18 ` Junio C Hamano
2009-11-30 18:55   ` Bernhard R. Link
2009-12-01  0:25     ` Junio C Hamano
2009-11-30 19:26   ` Johannes Sixt
2009-11-30 20:32     ` Junio C Hamano
2009-11-30 22:12   ` Nanako Shiraishi
2009-12-01  0:20     ` Junio C Hamano
2009-12-01  0:23       ` [PATCH] git-merge: a deprecation notice of the ancient command line syntax Junio C Hamano
2009-12-01  3:55         ` Nicolas Pitre
2009-12-01  4:07           ` Junio C Hamano
2009-12-02 10:20       ` equal-tree-merges as way to make rebases fast-forward-able Nanako Shiraishi
2009-12-02 18:03         ` Junio C Hamano
2009-12-01 11:50 ` Michael Haggerty

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=4B13E67C.4050005@drmicha.warpmail.net \
    --to=git@drmicha$(echo .)warpmail.net \
    --cc=brlink@debian$(echo .)org \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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