All of lore.kernel.org
 help / color / mirror / Atom feed
* git commands that only work correctly at top directory
@ 2006-09-22  9:21 Nguyen Thai Ngoc Duy
  2006-09-22 11:12 ` [PATCH] format-patch: use cwd as default output directory Matthias Lederhofer
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2006-09-22  9:21 UTC (permalink / raw)
  To: git

Here is the list (checks are done in with 1.4.2.rc4):
count-objects (always 0 objects, 0 kilobytes)
bisect (fatal: Not a git repository: '.git'. Bad HEAD - I need a symbolic ref)
describe (fatal: Not a valid object name HEAD)
repack (line 42: cd: .git/objects/pack: No such file or directory. And
it creates a new .git directory in current directory)
git format-patch in subdir generates files in topdir instead of
current dir as documented in its man page

BTW, either git blame or git annotate should be available in git help's listing.
git format-patch with no argument shows nothing. It should show help
usage instead.
I might miss some commands because I only tested commands I'm familiar with.
-- 
Duy

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

* [PATCH] format-patch: use cwd as default output directory
  2006-09-22  9:21 git commands that only work correctly at top directory Nguyen Thai Ngoc Duy
@ 2006-09-22 11:12 ` Matthias Lederhofer
  2006-09-28 10:25   ` Nguyen Thai Ngoc Duy
  2006-09-22 11:26 ` git commands that only work correctly at top directory Matthias Lederhofer
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Matthias Lederhofer @ 2006-09-22 11:12 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: git

---
Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> git format-patch in subdir generates files in topdir instead of
> current dir as documented in its man page
Here is a patch for this.
---
 builtin-log.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/builtin-log.c b/builtin-log.c
index fbc58bb..130b53a 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -270,6 +270,8 @@ int cmd_format_patch(int argc, const cha
 
 	rev.extra_headers = extra_headers;
 
+	output_directory = prefix;
+
 	/*
 	 * Parse the arguments before setup_revisions(), or something
 	 * like "git fmt-patch -o a123 HEAD^.." may fail; a123 is
-- 
1.4.2.1.ge767

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

* Re: git commands that only work correctly at top directory
  2006-09-22  9:21 git commands that only work correctly at top directory Nguyen Thai Ngoc Duy
  2006-09-22 11:12 ` [PATCH] format-patch: use cwd as default output directory Matthias Lederhofer
@ 2006-09-22 11:26 ` Matthias Lederhofer
  2006-09-22 12:57   ` Nguyen Thai Ngoc Duy
  2006-09-23 15:16   ` Petr Baudis
  2006-09-22 15:10 ` [PATCH] git-repack: allow git-repack to run in subdirectory Jeff King
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 12+ messages in thread
From: Matthias Lederhofer @ 2006-09-22 11:26 UTC (permalink / raw)
  To: git

Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> Here is the list (checks are done in with 1.4.2.rc4):
> count-objects (always 0 objects, 0 kilobytes)
> bisect (fatal: Not a git repository: '.git'. Bad HEAD - I need a symbolic 
> ref)
> describe (fatal: Not a valid object name HEAD)
> repack (line 42: cd: .git/objects/pack: No such file or directory. And
> it creates a new .git directory in current directory)
count-objects and describe work in the current master.
repack/bisect/reset and some other commands make only sense from the
toplevel directory but anyway I would allow them to be run in a
subdirectory and change up to the topdirectory (like git checkout for
branch switching).  Is there any good reason not to do this?  I found
it often annoying to go down to the toplevel directory/get a new shell
just to reset to HEAD~1.

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

* Re: git commands that only work correctly at top directory
  2006-09-22 11:26 ` git commands that only work correctly at top directory Matthias Lederhofer
@ 2006-09-22 12:57   ` Nguyen Thai Ngoc Duy
  2006-09-23 15:16   ` Petr Baudis
  1 sibling, 0 replies; 12+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2006-09-22 12:57 UTC (permalink / raw)
  To: git

On 9/22/06, Matthias Lederhofer <matled@gmx.net> wrote:
> count-objects and describe work in the current master.
Yes. Somehow my master is not updated to origin :(

> repack/bisect/reset and some other commands make only sense from the
> toplevel directory but anyway I would allow them to be run in a
> subdirectory and change up to the topdirectory (like git checkout for
> branch switching).  Is there any good reason not to do this?  I found
> it often annoying to go down to the toplevel directory/get a new shell
> just to reset to HEAD~1.
In case there is good reason not to do it, I'd like those commands to
tell users run them in top directory. (Although I prefer to run it
everywhere, I hate to cd around just for one command)
-- 
Duy

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

* [PATCH] git-repack: allow git-repack to run in subdirectory
  2006-09-22  9:21 git commands that only work correctly at top directory Nguyen Thai Ngoc Duy
  2006-09-22 11:12 ` [PATCH] format-patch: use cwd as default output directory Matthias Lederhofer
  2006-09-22 11:26 ` git commands that only work correctly at top directory Matthias Lederhofer
@ 2006-09-22 15:10 ` Jeff King
  2006-09-22 17:08 ` git commands that only work correctly at top directory Thomas Kolejka
  2006-09-25  2:31 ` [PATCH/RESEND] git-repack: allow git-repack to run in subdirectory Jeff King
  4 siblings, 0 replies; 12+ messages in thread
From: Jeff King @ 2006-09-22 15:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Nguyen Thai Ngoc Duy

Now that we explicitly create all tmpfiles below $GIT_DIR, there's no reason
to care about which directory we're in.

Signed-off-by: Jeff King <peff@peff.net>
---
 git-repack.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/git-repack.sh b/git-repack.sh
index 9ae5092..f2c9071 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -4,6 +4,7 @@ # Copyright (c) 2005 Linus Torvalds
 #
 
 USAGE='[-a] [-d] [-f] [-l] [-n] [-q]'
+SUBDIRECTORY_OK='Yes'
 . git-sh-setup
 
 no_update_info= all_into_one= remove_redundant=
-- 
1.4.2.1.gb6052-dirty

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

* Re: git commands that only work correctly at top directory
  2006-09-22  9:21 git commands that only work correctly at top directory Nguyen Thai Ngoc Duy
                   ` (2 preceding siblings ...)
  2006-09-22 15:10 ` [PATCH] git-repack: allow git-repack to run in subdirectory Jeff King
@ 2006-09-22 17:08 ` Thomas Kolejka
  2006-09-25  2:31 ` [PATCH/RESEND] git-repack: allow git-repack to run in subdirectory Jeff King
  4 siblings, 0 replies; 12+ messages in thread
From: Thomas Kolejka @ 2006-09-22 17:08 UTC (permalink / raw)
  To: git; +Cc: Nguyen Thai Ngoc Duy


-------- Original-Nachricht --------
Datum: Fri, 22 Sep 2006 16:21:09 +0700
Von: "Nguyen Thai Ngoc Duy" <pclouds@gmail.com>
An: git@vger.kernel.org
Betreff: git commands that only work correctly at top directory

Did you set $GIT_DIR? ... to an absolute path or "./.git" ?

> Here is the list (checks are done in with 1.4.2.rc4):
> count-objects (always 0 objects, 0 kilobytes)

Works for me in every directory with GIT_DIR abolute or ./.git

> bisect (fatal: Not a git repository: '.git'. Bad HEAD - I need a symbolic
> ref)

with an absolute GIT_DIR works from every directory - at least bisect start

> describe (fatal: Not a valid object name HEAD)

with an absolute GIT_DIR works from every directory.
v1.4.1-gcddb939


> repack (line 42: cd: .git/objects/pack: No such file or directory. And
> it creates a new .git directory in current directory)
> git format-patch in subdir generates files in topdir instead of
> current dir as documented in its man page
> 
> BTW, either git blame or git annotate should be available in git help's
> listing.
> git format-patch with no argument shows nothing. It should show help
> usage instead.
> I might miss some commands because I only tested commands I'm familiar
> with.
> -- 
> Duy


Thomas

-- 
NEU: GMX DSL Sofort-Start-Set - blitzschnell ins Internet!
Echte DSL-Flatrate ab 0,- Euro* http://www.gmx.net/de/go/dsl

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

* Re: git commands that only work correctly at top directory
  2006-09-22 11:26 ` git commands that only work correctly at top directory Matthias Lederhofer
  2006-09-22 12:57   ` Nguyen Thai Ngoc Duy
@ 2006-09-23 15:16   ` Petr Baudis
  1 sibling, 0 replies; 12+ messages in thread
From: Petr Baudis @ 2006-09-23 15:16 UTC (permalink / raw)
  To: git

Dear diary, on Fri, Sep 22, 2006 at 01:26:15PM CEST, I got a letter
where Matthias Lederhofer <matled@gmx.net> said that...
> repack/bisect/reset and some other commands make only sense from the
> toplevel directory but anyway I would allow them to be run in a
> subdirectory and change up to the topdirectory (like git checkout for
> branch switching).  Is there any good reason not to do this?  I found
> it often annoying to go down to the toplevel directory/get a new shell
> just to reset to HEAD~1.

Probably not for repack, but in case of bisect and especially reset it
would be reasonable to expect that it will touch just the subdirectory
and in case of git reset --hard that could be deadly.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)

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

* [PATCH/RESEND] git-repack: allow git-repack to run in subdirectory
  2006-09-22  9:21 git commands that only work correctly at top directory Nguyen Thai Ngoc Duy
                   ` (3 preceding siblings ...)
  2006-09-22 17:08 ` git commands that only work correctly at top directory Thomas Kolejka
@ 2006-09-25  2:31 ` Jeff King
  2006-09-25  3:16   ` Junio C Hamano
  4 siblings, 1 reply; 12+ messages in thread
From: Jeff King @ 2006-09-25  2:31 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Now that we explicitly create all tmpfiles below $GIT_DIR, there's no reason
to care about which directory we're in.

Signed-off-by: Jeff King <peff@peff.net>
---
There was no response on this; is there any reason not to allow this, or
did it just get dropped?

 git-repack.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/git-repack.sh b/git-repack.sh
index 9ae5092..f2c9071 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -4,6 +4,7 @@ # Copyright (c) 2005 Linus Torvalds
 #
 
 USAGE='[-a] [-d] [-f] [-l] [-n] [-q]'
+SUBDIRECTORY_OK='Yes'
 . git-sh-setup
 
 no_update_info= all_into_one= remove_redundant=
-- 
1.4.2.1.gb6052-dirty

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

* Re: [PATCH/RESEND] git-repack: allow git-repack to run in subdirectory
  2006-09-25  2:31 ` [PATCH/RESEND] git-repack: allow git-repack to run in subdirectory Jeff King
@ 2006-09-25  3:16   ` Junio C Hamano
  0 siblings, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2006-09-25  3:16 UTC (permalink / raw)
  To: Jeff King; +Cc: git

Jeff King <peff@peff.net> writes:

> Now that we explicitly create all tmpfiles below $GIT_DIR, there's no reason
> to care about which directory we're in.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> There was no response on this; is there any reason not to allow this, or
> did it just get dropped?

Simply forgotten; it might be _correct_ but it is not important.

While it may technically be correct that the command could be
run from anywhere, repack is a whole repository operation, and
it is an operation performed not that often.  There is no reason
to forbid it to run from subdirectories, but it does not hurt
users much if it did.

Will queue for "next" and push it out before 1.4.3 if I do not
forget it again ;-).

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

* Re: [PATCH] format-patch: use cwd as default output directory
  2006-09-22 11:12 ` [PATCH] format-patch: use cwd as default output directory Matthias Lederhofer
@ 2006-09-28 10:25   ` Nguyen Thai Ngoc Duy
  2006-09-28 16:16     ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2006-09-28 10:25 UTC (permalink / raw)
  To: git, Junio C Hamano

This patch works great. I assume you forgot it?

On 9/22/06, Matthias Lederhofer <matled@gmx.net> wrote:
> ---
> Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> > git format-patch in subdir generates files in topdir instead of
> > current dir as documented in its man page
> Here is a patch for this.
> ---
>  builtin-log.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/builtin-log.c b/builtin-log.c
> index fbc58bb..130b53a 100644
> --- a/builtin-log.c
> +++ b/builtin-log.c
> @@ -270,6 +270,8 @@ int cmd_format_patch(int argc, const cha
>
>         rev.extra_headers = extra_headers;
>
> +       output_directory = prefix;
> +
>         /*
>          * Parse the arguments before setup_revisions(), or something
>          * like "git fmt-patch -o a123 HEAD^.." may fail; a123 is
> --
> 1.4.2.1.ge767
>
>
-- 
Duy

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

* Re: [PATCH] format-patch: use cwd as default output directory
  2006-09-28 10:25   ` Nguyen Thai Ngoc Duy
@ 2006-09-28 16:16     ` Junio C Hamano
  2006-09-28 19:55       ` [PATCH] git-format-patch: fix bug using -o in subdirectories Matthias Lederhofer
  0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2006-09-28 16:16 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: git

"Nguyen Thai Ngoc Duy" <pclouds@gmail.com> writes:

> This patch works great. I assume you forgot it?

Thanks for reminding.

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

* [PATCH] git-format-patch: fix bug using -o in subdirectories
  2006-09-28 16:16     ` Junio C Hamano
@ 2006-09-28 19:55       ` Matthias Lederhofer
  0 siblings, 0 replies; 12+ messages in thread
From: Matthias Lederhofer @ 2006-09-28 19:55 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

This was introduced by me in commit v1.4.2.1-gc08e524.

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
---
Junio C Hamano <junkio@cox.net> wrote:
> "Nguyen Thai Ngoc Duy" <pclouds@gmail.com> writes:
> 
> > This patch works great. I assume you forgot it?
> 
> Thanks for reminding.
Argh, there is a bug.  When prefix is not NULL and -o is specified
git-format-patch fails:
~/src/git/a% ../git-format-patch -o ./b HEAD~1
fatal: Two output directories?
---
 builtin-log.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/builtin-log.c b/builtin-log.c
index 130b53a..9d1ceae 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -270,8 +270,6 @@ int cmd_format_patch(int argc, const cha
 
 	rev.extra_headers = extra_headers;
 
-	output_directory = prefix;
-
 	/*
 	 * Parse the arguments before setup_revisions(), or something
 	 * like "git fmt-patch -o a123 HEAD^.." may fail; a123 is
@@ -350,6 +348,9 @@ int cmd_format_patch(int argc, const cha
 	if (!rev.diffopt.output_format)
 		rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;
 
+	if (!output_directory)
+		output_directory = prefix;
+
 	if (output_directory) {
 		if (use_stdout)
 			die("standard output, or directory, which one?");
-- 
1.4.2.1.ge767

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

end of thread, other threads:[~2006-09-28 19:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-22  9:21 git commands that only work correctly at top directory Nguyen Thai Ngoc Duy
2006-09-22 11:12 ` [PATCH] format-patch: use cwd as default output directory Matthias Lederhofer
2006-09-28 10:25   ` Nguyen Thai Ngoc Duy
2006-09-28 16:16     ` Junio C Hamano
2006-09-28 19:55       ` [PATCH] git-format-patch: fix bug using -o in subdirectories Matthias Lederhofer
2006-09-22 11:26 ` git commands that only work correctly at top directory Matthias Lederhofer
2006-09-22 12:57   ` Nguyen Thai Ngoc Duy
2006-09-23 15:16   ` Petr Baudis
2006-09-22 15:10 ` [PATCH] git-repack: allow git-repack to run in subdirectory Jeff King
2006-09-22 17:08 ` git commands that only work correctly at top directory Thomas Kolejka
2006-09-25  2:31 ` [PATCH/RESEND] git-repack: allow git-repack to run in subdirectory Jeff King
2006-09-25  3:16   ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.