pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PR/42168 CVS commit: pkgsrc/devel/scmgit-base



The following reply was made to PR pkg/42168; it has been noted by GNATS.

From: Steven Drake <sdrake%xnet.co.nz@localhost>
To: Thomas Klausner <wiz%netbsd.org@localhost>
Cc: bjs%NetBSD.org@localhost, gnats-bugs%gnats.netbsd.org@localhost, 
pkgsrc-bugs%netbsd.org@localhost, 
    dmcmahill%netbsd.org@localhost
Subject: Re: PR/42168 CVS commit: pkgsrc/devel/scmgit-base
Date: Sun, 10 Jan 2010 20:59:19 +1300 (NZDT)

 Or you could try the following patches that I've also sent to the git list. 
 
 Index: patches/patch-ad
 ===================================================================
 RCS file: patches/patch-ad
 diff -N patches/patch-ad
 --- /dev/null  1 Jan 1970 00:00:00 -0000
 +++ patches/patch-ad   10 Jan 2010 07:54:08 -0000
 @@ -0,0 +1,14 @@
 +$NetBSD$
 +
 +--- Documentation/git-rev-parse.txt.orig      2009-07-29 20:18:18.000000000 
+1200
 ++++ Documentation/git-rev-parse.txt
 +@@ -112,6 +112,9 @@ OPTIONS
 + --remotes::
 +      Show tag refs found in `$GIT_DIR/refs/remotes`.
 + 
 ++--show-toplevel::
 ++     Show the absolute path of the top-level directory.
 ++
 + --show-prefix::
 +      When the command is invoked from a subdirectory, show the
 +      path of the current directory relative to the top-level
 Index: patches/patch-aj
 ===================================================================
 RCS file: patches/patch-aj
 diff -N patches/patch-aj
 --- /dev/null  1 Jan 1970 00:00:00 -0000
 +++ patches/patch-aj   10 Jan 2010 07:54:08 -0000
 @@ -0,0 +1,20 @@
 +$NetBSD$
 +
 +Add 'git rev-parse --show-toplevel' option.
 +Shows the absolute path of the top-level working directory.
 +
 +--- builtin-rev-parse.c.orig  2009-07-29 20:18:18.000000000 +1200
 ++++ builtin-rev-parse.c
 +@@ -560,6 +560,12 @@ int cmd_rev_parse(int argc, const char *
 +                              for_each_remote_ref(show_reference, NULL);
 +                              continue;
 +                      }
 ++                     if (!strcmp(arg, "--show-toplevel")) {
 ++                             const char *work_tree = get_git_work_tree();
 ++                             if (work_tree)
 ++                                     printf("%s\n", work_tree);
 ++                             continue;
 ++                     }
 +                      if (!strcmp(arg, "--show-prefix")) {
 +                              if (prefix)
 +                                      puts(prefix);
 Index: patches/patch-ak
 ===================================================================
 RCS file: patches/patch-ak
 diff -N patches/patch-ak
 --- /dev/null  1 Jan 1970 00:00:00 -0000
 +++ patches/patch-ak   10 Jan 2010 07:54:08 -0000
 @@ -0,0 +1,28 @@
 +$NetBSD$
 +
 +Use $(git rev-parse --show-toplevel) in cd_to_toplevel()
 +as it gives the absolute (aka "physical") path of the toplevel directory 
 +and 'cd -P' is not supported by all shell implementations.
 +
 +--- git-sh-setup.sh.orig      2009-07-29 20:18:18.000000000 +1200
 ++++ git-sh-setup.sh
 +@@ -119,16 +119,10 @@ is_bare_repository () {
 + }
 + 
 + cd_to_toplevel () {
 +-     cdup=$(git rev-parse --show-cdup)
 +-     if test ! -z "$cdup"
 ++     if test ! -z "$(git rev-parse --show-cdup)"
 +      then
 +-             # The "-P" option says to follow "physical" directory
 +-             # structure instead of following symbolic links.  When cdup is
 +-             # "../", this means following the ".." entry in the current
 +-             # directory instead textually removing a symlink path element
 +-             # from the PWD shell variable.  The "-P" behavior is more
 +-             # consistent with the C-style chdir used by most of Git.
 +-             cd -P "$cdup" || {
 ++             cdup=$(git rev-parse --show-toplevel)
 ++             cd "$cdup" || {
 +                      echo >&2 "Cannot chdir to $cdup, the toplevel of the 
working tree"
 +                      exit 1
 +              }
 
 -- 
 Steven
 


Home | Main Index | Thread Index | Old Index