git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH] Remove repo-config
@ 2008-01-16  3:19 Dan McGee
  2008-01-16  4:23 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Dan McGee @ 2008-01-16  3:19 UTC (permalink / raw)
  To: git; +Cc: Dan McGee

'git config' has been used in place of 'git repo-config' for some time in
the documentation and most of the tools, so remove traces of repo-config
from the source.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
---

Mainly a request for comment, but I sent this patch becuase I noticed
repo-config is not even listed in command-list.txt. Before the 1.5.4 release,
I would think it either needs to be listed there or removed entirely.

Looking forward to 1.5.5, is there any reason to keep an old command like
this around? It is rarely used and needlessly complicates things, and the
manpage did nothing but send you to config anyway.

All tests pass on Linux 2.6.23.

-Dan

 Documentation/git-repo-config.txt      |   18 ------------------
 Makefile                               |    4 ++--
 contrib/completion/git-completion.bash |    1 -
 contrib/examples/git-tag.sh            |    1 +
 git.c                                  |    1 -
 t/t0020-crlf.sh                        |   24 ++++++++++++------------
 t/t9200-git-cvsexportcommit.sh         |    2 +-
 templates/hooks--update                |    8 ++++----
 8 files changed, 20 insertions(+), 39 deletions(-)
 delete mode 100644 Documentation/git-repo-config.txt

diff --git a/Documentation/git-repo-config.txt b/Documentation/git-repo-config.txt
deleted file mode 100644
index 2ca3994..0000000
--- a/Documentation/git-repo-config.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-git-repo-config(1)
-==================
-
-NAME
-----
-git-repo-config - Get and set repository or global options
-
-
-SYNOPSIS
---------
-'git-repo-config' ...
-
-
-DESCRIPTION
------------
-
-This is a synonym for linkgit:git-config[1].  Please refer to the
-documentation of that command.
diff --git a/Makefile b/Makefile
index 82e9cd6..603f4ac 100644
--- a/Makefile
+++ b/Makefile
@@ -262,7 +262,7 @@ EXTRA_PROGRAMS =
 
 BUILT_INS = \
 	git-format-patch$X git-show$X git-whatchanged$X git-cherry$X \
-	git-get-tar-commit-id$X git-init$X git-repo-config$X \
+	git-get-tar-commit-id$X git-init$X \
 	git-fsck-objects$X git-cherry-pick$X git-peek-remote$X git-status$X \
 	$(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS))
 
@@ -1145,7 +1145,7 @@ check-docs::
 		case "$$v" in \
 		git-merge-octopus | git-merge-ours | git-merge-recursive | \
 		git-merge-resolve | git-merge-stupid | git-merge-subtree | \
-		git-fsck-objects | git-init-db | git-repo-config | \
+		git-fsck-objects | git-init-db | \
 		git-?*--?* ) continue ;; \
 		esac ; \
 		test -f "Documentation/$$v.txt" || \
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 343364d..c63a642 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -333,7 +333,6 @@ __git_commands ()
 		read-tree)        : plumbing;;
 		receive-pack)     : plumbing;;
 		reflog)           : plumbing;;
-		repo-config)      : plumbing;;
 		rerere)           : plumbing;;
 		rev-list)         : plumbing;;
 		rev-parse)        : plumbing;;
diff --git a/contrib/examples/git-tag.sh b/contrib/examples/git-tag.sh
index ae7c531..a3182df 100755
--- a/contrib/examples/git-tag.sh
+++ b/contrib/examples/git-tag.sh
@@ -167,6 +167,7 @@ type=$(git cat-file -t $object) || exit 1
 tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1
 
 test -n "$username" ||
+	#NOTE: 'git repo-config' has since been replaced by 'git config'
 	username=$(git repo-config user.signingkey) ||
 	username=$(expr "z$tagger" : 'z\(.*>\)')
 
diff --git a/git.c b/git.c
index 15fec89..061d365 100644
--- a/git.c
+++ b/git.c
@@ -340,7 +340,6 @@ static void handle_internal_command(int argc, const char **argv)
 		{ "push", cmd_push, RUN_SETUP },
 		{ "read-tree", cmd_read_tree, RUN_SETUP },
 		{ "reflog", cmd_reflog, RUN_SETUP },
-		{ "repo-config", cmd_config },
 		{ "rerere", cmd_rerere, RUN_SETUP },
 		{ "reset", cmd_reset, RUN_SETUP },
 		{ "rev-list", cmd_rev_list, RUN_SETUP },
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index 89baebd..8b27aa8 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -19,7 +19,7 @@ remove_cr () {
 
 test_expect_success setup '
 
-	git repo-config core.autocrlf false &&
+	git config core.autocrlf false &&
 
 	for w in Hello world how are you; do echo $w; done >one &&
 	mkdir dir &&
@@ -46,7 +46,7 @@ test_expect_success 'update with autocrlf=input' '
 
 	rm -f tmp one dir/two three &&
 	git read-tree --reset -u HEAD &&
-	git repo-config core.autocrlf input &&
+	git config core.autocrlf input &&
 
 	for f in one dir/two
 	do
@@ -70,7 +70,7 @@ test_expect_success 'update with autocrlf=true' '
 
 	rm -f tmp one dir/two three &&
 	git read-tree --reset -u HEAD &&
-	git repo-config core.autocrlf true &&
+	git config core.autocrlf true &&
 
 	for f in one dir/two
 	do
@@ -93,7 +93,7 @@ test_expect_success 'update with autocrlf=true' '
 test_expect_success 'checkout with autocrlf=true' '
 
 	rm -f tmp one dir/two three &&
-	git repo-config core.autocrlf true &&
+	git config core.autocrlf true &&
 	git read-tree --reset -u HEAD &&
 
 	for f in one dir/two
@@ -117,7 +117,7 @@ test_expect_success 'checkout with autocrlf=true' '
 test_expect_success 'checkout with autocrlf=input' '
 
 	rm -f tmp one dir/two three &&
-	git repo-config core.autocrlf input &&
+	git config core.autocrlf input &&
 	git read-tree --reset -u HEAD &&
 
 	for f in one dir/two
@@ -143,7 +143,7 @@ test_expect_success 'checkout with autocrlf=input' '
 test_expect_success 'apply patch (autocrlf=input)' '
 
 	rm -f tmp one dir/two three &&
-	git repo-config core.autocrlf input &&
+	git config core.autocrlf input &&
 	git read-tree --reset -u HEAD &&
 
 	git apply patch.file &&
@@ -156,7 +156,7 @@ test_expect_success 'apply patch (autocrlf=input)' '
 test_expect_success 'apply patch --cached (autocrlf=input)' '
 
 	rm -f tmp one dir/two three &&
-	git repo-config core.autocrlf input &&
+	git config core.autocrlf input &&
 	git read-tree --reset -u HEAD &&
 
 	git apply --cached patch.file &&
@@ -169,7 +169,7 @@ test_expect_success 'apply patch --cached (autocrlf=input)' '
 test_expect_success 'apply patch --index (autocrlf=input)' '
 
 	rm -f tmp one dir/two three &&
-	git repo-config core.autocrlf input &&
+	git config core.autocrlf input &&
 	git read-tree --reset -u HEAD &&
 
 	git apply --index patch.file &&
@@ -183,7 +183,7 @@ test_expect_success 'apply patch --index (autocrlf=input)' '
 test_expect_success 'apply patch (autocrlf=true)' '
 
 	rm -f tmp one dir/two three &&
-	git repo-config core.autocrlf true &&
+	git config core.autocrlf true &&
 	git read-tree --reset -u HEAD &&
 
 	git apply patch.file &&
@@ -196,7 +196,7 @@ test_expect_success 'apply patch (autocrlf=true)' '
 test_expect_success 'apply patch --cached (autocrlf=true)' '
 
 	rm -f tmp one dir/two three &&
-	git repo-config core.autocrlf true &&
+	git config core.autocrlf true &&
 	git read-tree --reset -u HEAD &&
 
 	git apply --cached patch.file &&
@@ -209,7 +209,7 @@ test_expect_success 'apply patch --cached (autocrlf=true)' '
 test_expect_success 'apply patch --index (autocrlf=true)' '
 
 	rm -f tmp one dir/two three &&
-	git repo-config core.autocrlf true &&
+	git config core.autocrlf true &&
 	git read-tree --reset -u HEAD &&
 
 	git apply --index patch.file &&
@@ -224,7 +224,7 @@ test_expect_success '.gitattributes says two is binary' '
 
 	rm -f tmp one dir/two three &&
 	echo "two -crlf" >.gitattributes &&
-	git repo-config core.autocrlf true &&
+	git config core.autocrlf true &&
 	git read-tree --reset -u HEAD &&
 
 	if remove_cr dir/two >/dev/null
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index 910c584..a15222c 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -225,7 +225,7 @@ test_expect_success \
       ! git-cvsexportcommit -c $id
       )'
 
-case "$(git repo-config --bool core.filemode)" in
+case "$(git config --bool core.filemode)" in
 false)
 	;;
 *)
diff --git a/templates/hooks--update b/templates/hooks--update
index bd93dd1..09a99ff 100644
--- a/templates/hooks--update
+++ b/templates/hooks--update
@@ -37,9 +37,9 @@ if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
 fi
 
 # --- Config
-allowunannotated=$(git-repo-config --bool hooks.allowunannotated)
-allowdeletebranch=$(git-repo-config --bool hooks.allowdeletebranch)
-allowdeletetag=$(git-repo-config --bool hooks.allowdeletetag)
+allowunannotated=$(git config --bool hooks.allowunannotated)
+allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
+allowdeletetag=$(git config --bool hooks.allowdeletetag)
 
 # check for no description
 projectdesc=$(sed -e '1q' "$GIT_DIR/description")
@@ -53,7 +53,7 @@ fi
 if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then
 	newrev_type=delete
 else
-	newrev_type=$(git-cat-file -t $newrev)
+	newrev_type=$(git cat-file -t $newrev)
 fi
 
 case "$refname","$newrev_type" in
-- 
1.5.4.rc3

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

* Re: [RFC/PATCH] Remove repo-config
  2008-01-16  3:19 [RFC/PATCH] Remove repo-config Dan McGee
@ 2008-01-16  4:23 ` Junio C Hamano
  2008-01-16  4:40   ` Dan McGee
  2008-01-16 20:13 ` Junio C Hamano
  2008-01-16 20:47 ` Peter Oberndorfer
  2 siblings, 1 reply; 21+ messages in thread
From: Junio C Hamano @ 2008-01-16  4:23 UTC (permalink / raw)
  To: Dan McGee; +Cc: git

I do not think it is unreasonable to add repo-config to feature
removal schedule in 1.5.4 release notes.  Perhaps something like...

diff --git a/Documentation/RelNotes-1.5.4.txt b/Documentation/RelNotes-1.5.4.txt
index 7d2a973..97a9bd9 100644
--- a/Documentation/RelNotes-1.5.4.txt
+++ b/Documentation/RelNotes-1.5.4.txt
@@ -46,6 +46,10 @@ Deprecation notices
    and works for all transports; "git peek-remote" will be removed in
    the future.
 
+ * "git repo-config", which was an old name for "git config" command,
+   has been supported without being advertised for a long time.  The
+   next feature release will remove it.
+
  * From v1.6.0, the repack.usedeltabaseoffset config option will default
    to true, which will give denser packfiles (i.e. more efficient storage).
    The downside is that git older than version 1.4.4 will not be able

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

* Re: [RFC/PATCH] Remove repo-config
  2008-01-16  4:23 ` Junio C Hamano
@ 2008-01-16  4:40   ` Dan McGee
  2008-01-16 17:20     ` Junio C Hamano
  0 siblings, 1 reply; 21+ messages in thread
From: Dan McGee @ 2008-01-16  4:40 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On 01/15/2008 10:23 PM, Junio C Hamano wrote:
> I do not think it is unreasonable to add repo-config to feature
> removal schedule in 1.5.4 release notes.  Perhaps something like...
> 
> + * "git repo-config", which was an old name for "git config" command,
> +   has been supported without being advertised for a long time.  The
> +   next feature release will remove it.
> +

Seems fine to me. Does it need to be put in command-list.txt for the time being too, or what all is that file used for? Sorry I am not familiar.

Something like:

git-repo-config                       ancillarymanipulators	deprecated

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

* Re: [RFC/PATCH] Remove repo-config
  2008-01-16  4:40   ` Dan McGee
@ 2008-01-16 17:20     ` Junio C Hamano
  2008-01-16 20:32       ` Junio C Hamano
  0 siblings, 1 reply; 21+ messages in thread
From: Junio C Hamano @ 2008-01-16 17:20 UTC (permalink / raw)
  To: Dan McGee; +Cc: git

Dan McGee <dpmcgee@gmail.com> writes:

> On 01/15/2008 10:23 PM, Junio C Hamano wrote:
>> I do not think it is unreasonable to add repo-config to feature
>> removal schedule in 1.5.4 release notes.  Perhaps something like...
>> 
>> + * "git repo-config", which was an old name for "git config" command,
>> +   has been supported without being advertised for a long time.  The
>> +   next feature release will remove it.
>> +
>
> Seems fine to me. Does it need to be put in command-list.txt for the time being too, or what all is that file used for? Sorry I am not familiar.
>
> Something like:
>
> git-repo-config                       ancillarymanipulators	deprecated

Technically, you are right, but somehow it feels backwards.

We stopped advertising the existence of the command in v1.5.0,
and adding it to the list now would mean we need to add a new
git-repo-config manual page that says "This is deprecated, use
git-config instead".

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

* Re: [RFC/PATCH] Remove repo-config
  2008-01-16  3:19 [RFC/PATCH] Remove repo-config Dan McGee
  2008-01-16  4:23 ` Junio C Hamano
@ 2008-01-16 20:13 ` Junio C Hamano
  2008-01-16 20:47 ` Peter Oberndorfer
  2 siblings, 0 replies; 21+ messages in thread
From: Junio C Hamano @ 2008-01-16 20:13 UTC (permalink / raw)
  To: Dan McGee; +Cc: git

Dan McGee <dpmcgee@gmail.com> writes:

> 'git config' has been used in place of 'git repo-config' for some time in
> the documentation and most of the tools, so remove traces of repo-config
> from the source.
>
> Signed-off-by: Dan McGee <dpmcgee@gmail.com>

I'd agree with the deprecation.  We stopped advertising it long
time ago (1.5.0 I think).

> diff --git a/Documentation/git-repo-config.txt b/Documentation/git-repo-config.txt

Let's defer the removal til post 1.5.4.

> diff --git a/Makefile b/Makefile

Likewise.

> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash

Likewise.

> diff --git a/contrib/examples/git-tag.sh b/contrib/examples/git-tag.sh
> index ae7c531..a3182df 100755
> --- a/contrib/examples/git-tag.sh
> +++ b/contrib/examples/git-tag.sh
> @@ -167,6 +167,7 @@ type=$(git cat-file -t $object) || exit 1
>  tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1
>  
>  test -n "$username" ||
> +	#NOTE: 'git repo-config' has since been replaced by 'git config'
>  	username=$(git repo-config user.signingkey) ||
>  	username=$(expr "z$tagger" : 'z\(.*>\)')

Good.

> diff --git a/git.c b/git.c

Deferred.

> diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
> diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh

Doing s/repo-config/config/ in test scripts is good.

> diff --git a/templates/hooks--update b/templates/hooks--update
> index bd93dd1..09a99ff 100644
> --- a/templates/hooks--update
> +++ b/templates/hooks--update
> @@ -37,9 +37,9 @@ if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
>  fi
>  
>  # --- Config
> -allowunannotated=$(git-repo-config --bool hooks.allowunannotated)
> -allowdeletebranch=$(git-repo-config --bool hooks.allowdeletebranch)
> -allowdeletetag=$(git-repo-config --bool hooks.allowdeletetag)
> +allowunannotated=$(git config --bool hooks.allowunannotated)
> +allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
> +allowdeletetag=$(git config --bool hooks.allowdeletetag)
>  
>  # check for no description
>  projectdesc=$(sed -e '1q' "$GIT_DIR/description")

Good.


> @@ -53,7 +53,7 @@ fi
>  if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then
>  	newrev_type=delete
>  else
> -	newrev_type=$(git-cat-file -t $newrev)
> +	newrev_type=$(git cat-file -t $newrev)
>  fi
>  
>  case "$refname","$newrev_type" in

Good but does not belong to the topic.

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

* Re: [RFC/PATCH] Remove repo-config
  2008-01-16 17:20     ` Junio C Hamano
@ 2008-01-16 20:32       ` Junio C Hamano
  0 siblings, 0 replies; 21+ messages in thread
From: Junio C Hamano @ 2008-01-16 20:32 UTC (permalink / raw)
  To: Dan McGee; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> Dan McGee <dpmcgee@gmail.com> writes:
>
>> On 01/15/2008 10:23 PM, Junio C Hamano wrote:
>>> I do not think it is unreasonable to add repo-config to feature
>>> removal schedule in 1.5.4 release notes.  Perhaps something like...
>>> 
>>> + * "git repo-config", which was an old name for "git config" command,
>>> +   has been supported without being advertised for a long time.  The
>>> +   next feature release will remove it.
>>> +
>>
>> Seems fine to me. Does it need to be put in command-list.txt for the time being too, or what all is that file used for? Sorry I am not familiar.
>>
>> Something like:
>>
>> git-repo-config                       ancillarymanipulators	deprecated
>
> Technically, you are right, but somehow it feels backwards.
>
> We stopped advertising the existence of the command in v1.5.0,
> and adding it to the list now would mean we need to add a new
> git-repo-config manual page that says "This is deprecated, use
> git-config instead".

This comment was wrong.  We can keep the existing repo-config
documentation that has deprecation notice, and add the above
line to the list.

Sorry about the confusion.

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

* Re: [RFC/PATCH] Remove repo-config
  2008-01-16  3:19 [RFC/PATCH] Remove repo-config Dan McGee
  2008-01-16  4:23 ` Junio C Hamano
  2008-01-16 20:13 ` Junio C Hamano
@ 2008-01-16 20:47 ` Peter Oberndorfer
  2008-01-16 20:58   ` [STGIT PATCH] replace "git repo-config" usage by "git config" Peter Oberndorfer
  2 siblings, 1 reply; 21+ messages in thread
From: Peter Oberndorfer @ 2008-01-16 20:47 UTC (permalink / raw)
  To: Dan McGee; +Cc: git, Catalin Marinas, Karl Hasselström

On Mittwoch 16 Januar 2008, Dan McGee wrote:
> 'git config' has been used in place of 'git repo-config' for some time in
> the documentation and most of the tools, so remove traces of repo-config
> from the source.
> 
> Signed-off-by: Dan McGee <dpmcgee@gmail.com>
> ---
> 
> Mainly a request for comment, but I sent this patch becuase I noticed
> repo-config is not even listed in command-list.txt. Before the 1.5.4 release,
> I would think it either needs to be listed there or removed entirely.
> 
> Looking forward to 1.5.5, is there any reason to keep an old command like
> this around? It is rarely used and needlessly complicates things, and the
> manpage did nothing but send you to config anyway.
> 
I don't know if this should impact removing schedule, but stgit 0.14.1
(and the current development version) uses "git repo-config" instead of "git config"
in stgit/config.py and certain tests

will post a patch for this as a reply
> All tests pass on Linux 2.6.23.
> 
> -Dan
Greetings Peter
PS: i hope it is ok to add stgit people to CC

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

* [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-16 20:47 ` Peter Oberndorfer
@ 2008-01-16 20:58   ` Peter Oberndorfer
  2008-01-16 21:13     ` Jakub Narebski
  2008-01-17  7:45     ` Karl Hasselström
  0 siblings, 2 replies; 21+ messages in thread
From: Peter Oberndorfer @ 2008-01-16 20:58 UTC (permalink / raw)
  To: Karl Hasselström; +Cc: Dan McGee, git, Catalin Marinas

"git repo-config" will be removed soon

Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
---
since i am not good at creating log messages, feel free to change it :-)
built on top of kha experimental patch
passes all testcases for me
 stgit/config.py               |   14 +++++++-------
 t/t1900-mail.sh               |    2 +-
 t/t2100-pull-policy-fetch.sh  |    4 ++--
 t/t2101-pull-policy-pull.sh   |    4 ++--
 t/t2102-pull-policy-rebase.sh |    4 ++--
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/stgit/config.py b/stgit/config.py
index 1d71cd2..9bfdd52 100644
--- a/stgit/config.py
+++ b/stgit/config.py
@@ -47,7 +47,7 @@ class GitConfig:
         if self.__cache.has_key(name):
             return self.__cache[name]
         try:
-            value = Run('git', 'repo-config', '--get', name).output_one_line()
+            value = Run('git', 'config', '--get', name).output_one_line()
         except RunException:
             value = self.__defaults.get(name, None)
         self.__cache[name] = value
@@ -56,7 +56,7 @@ class GitConfig:
     def getall(self, name):
         if self.__cache.has_key(name):
             return self.__cache[name]
-        values = Run('git', 'repo-config', '--get-all', name
+        values = Run('git', 'config', '--get-all', name
                      ).returns([0, 1]).output_lines()
         self.__cache[name] = values
         return values
@@ -71,23 +71,23 @@ class GitConfig:
     def rename_section(self, from_name, to_name):
         """Rename a section in the config file. Silently do nothing if
         the section doesn't exist."""
-        Run('git', 'repo-config', '--rename-section', from_name, to_name
+        Run('git', 'config', '--rename-section', from_name, to_name
             ).returns([0, 1]).run()
         self.__cache.clear()
 
     def remove_section(self, name):
         """Remove a section in the config file. Silently do nothing if
         the section doesn't exist."""
-        Run('git', 'repo-config', '--remove-section', name
+        Run('git', 'config', '--remove-section', name
             ).returns([0, 1]).discard_stderr().discard_output()
         self.__cache.clear()
 
     def set(self, name, value):
-        Run('git', 'repo-config', name, value).run()
+        Run('git', 'config', name, value).run()
         self.__cache[name] = value
 
     def unset(self, name):
-        Run('git', 'repo-config', '--unset', name)
+        Run('git', 'config', '--unset', name)
         self.__cache[name] = None
 
     def sections_matching(self, regexp):
@@ -96,7 +96,7 @@ class GitConfig:
         group contents, for all variable names matching the regexp.
         """
         result = []
-        for line in Run('git', 'repo-config', '--get-regexp', '"^%s$"' % regexp
+        for line in Run('git', 'config', '--get-regexp', '"^%s$"' % regexp
                         ).returns([0, 1]).output_lines():
             m = re.match('^%s ' % regexp, line)
             if m:
diff --git a/t/t1900-mail.sh b/t/t1900-mail.sh
index e83b2d3..cfdc6f3 100755
--- a/t/t1900-mail.sh
+++ b/t/t1900-mail.sh
@@ -6,7 +6,7 @@ test_description='Test the mail command'
 test_expect_success \
     'Initialize the StGIT repository' \
     '
-    git repo-config stgit.sender "A U Thor <author@example.com>" &&
+    git config stgit.sender "A U Thor <author@example.com>" &&
     for i in 1 2 3 4 5; do
       touch foo.txt &&
       echo "line $i" >> foo.txt &&
diff --git a/t/t2100-pull-policy-fetch.sh b/t/t2100-pull-policy-fetch.sh
index 9e4bc31..670c7c6 100755
--- a/t/t2100-pull-policy-fetch.sh
+++ b/t/t2100-pull-policy-fetch.sh
@@ -19,8 +19,8 @@ test_expect_success \
     (cd upstream && stg init) &&
     stg clone upstream clone &&
     (cd clone &&
-     git repo-config branch.master.stgit.pull-policy fetch-rebase &&
-     git repo-config --list &&
+     git config branch.master.stgit.pull-policy fetch-rebase &&
+     git config --list &&
      stg new c1 -m c1 &&
      echo a > file && git add file && stg refresh
     )
diff --git a/t/t2101-pull-policy-pull.sh b/t/t2101-pull-policy-pull.sh
index b4521f0..ce4b5c8 100755
--- a/t/t2101-pull-policy-pull.sh
+++ b/t/t2101-pull-policy-pull.sh
@@ -19,8 +19,8 @@ test_expect_success \
     (cd upstream && stg init) &&
     stg clone upstream clone &&
     (cd clone &&
-     git repo-config branch.master.stgit.pull-policy pull &&
-     git repo-config --list &&
+     git config branch.master.stgit.pull-policy pull &&
+     git config --list &&
      stg new c1 -m c1 &&
      echo a > file && git add file && stg refresh
     )
diff --git a/t/t2102-pull-policy-rebase.sh b/t/t2102-pull-policy-rebase.sh
index 135b48c..5619bda 100755
--- a/t/t2102-pull-policy-rebase.sh
+++ b/t/t2102-pull-policy-rebase.sh
@@ -13,8 +13,8 @@ test_expect_success \
     git branch -m master parent &&
     stg init &&
     stg branch --create stack &&
-    git repo-config branch.stack.stgit.pull-policy rebase &&
-    git repo-config --list &&
+    git config branch.stack.stgit.pull-policy rebase &&
+    git config --list &&
     stg new c1 -m c1 &&
     echo a > file && git add file && stg refresh
     '
-- 
1.5.4.rc3

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-16 20:58   ` [STGIT PATCH] replace "git repo-config" usage by "git config" Peter Oberndorfer
@ 2008-01-16 21:13     ` Jakub Narebski
  2008-01-16 21:46       ` Peter Oberndorfer
  2008-01-17 17:07       ` Catalin Marinas
  2008-01-17  7:45     ` Karl Hasselström
  1 sibling, 2 replies; 21+ messages in thread
From: Jakub Narebski @ 2008-01-16 21:13 UTC (permalink / raw)
  To: Peter Oberndorfer; +Cc: Karl Hasselström, Dan McGee, git, Catalin Marinas

Peter Oberndorfer <kumbayo84@arcor.de> writes:

> "git repo-config" will be removed soon
> 
> Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
> ---
> since i am not good at creating log messages, feel free to change it :-)
> built on top of kha experimental patch
> passes all testcases for me

> @@ -47,7 +47,7 @@ class GitConfig:
>          if self.__cache.has_key(name):
>              return self.__cache[name]
>          try:
> -            value = Run('git', 'repo-config', '--get', name).output_one_line()
> +            value = Run('git', 'config', '--get', name).output_one_line()
>          except RunException:
>              value = self.__defaults.get(name, None)
>          self.__cache[name] = value

Strange that StGIT didn't abstracted out reading git config, like
Git.pm and gitweb.perl did.

BTW. will StGIT be using libgit-thin + PyGit, or is it not ready yet?

-- 
Jakub Narebski
Poland
ShadeHawk on #git

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-16 21:13     ` Jakub Narebski
@ 2008-01-16 21:46       ` Peter Oberndorfer
  2008-01-17 17:07       ` Catalin Marinas
  1 sibling, 0 replies; 21+ messages in thread
From: Peter Oberndorfer @ 2008-01-16 21:46 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Karl Hasselström, Dan McGee, git, Catalin Marinas

On Mittwoch 16 Januar 2008, Jakub Narebski wrote:
> Peter Oberndorfer <kumbayo84@arcor.de> writes:
> 
> > "git repo-config" will be removed soon
> > 
> > Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
> > ---
> > since i am not good at creating log messages, feel free to change it :-)
> > built on top of kha experimental patch
> > passes all testcases for me
> 
> > @@ -47,7 +47,7 @@ class GitConfig:
> >          if self.__cache.has_key(name):
> >              return self.__cache[name]
> >          try:
> > -            value = Run('git', 'repo-config', '--get', 
name).output_one_line()
> > +            value = Run('git', 'config', '--get', name).output_one_line()
> >          except RunException:
> >              value = self.__defaults.get(name, None)
> >          self.__cache[name] = value
> 
> Strange that StGIT didn't abstracted out reading git config, like
> Git.pm and gitweb.perl did.
> 
It is abstracted, that is why the patch only affectes stgit/config.py :-)
(beside tests)
Or do you mean another type of abstraction like loading the whole config file 
at once?
> BTW. will StGIT be using libgit-thin + PyGit, or is it not ready yet?
> 
I did not hear about it lately.
But since i do not create stgit patches very often i have to say actually i 
actually have no idea.

Greetings Peter

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-16 20:58   ` [STGIT PATCH] replace "git repo-config" usage by "git config" Peter Oberndorfer
  2008-01-16 21:13     ` Jakub Narebski
@ 2008-01-17  7:45     ` Karl Hasselström
  2008-01-18  4:24       ` Karl Hasselström
  1 sibling, 1 reply; 21+ messages in thread
From: Karl Hasselström @ 2008-01-17  7:45 UTC (permalink / raw)
  To: Peter Oberndorfer; +Cc: Dan McGee, git, Catalin Marinas, Pavel Roskin

On 2008-01-16 21:58:26 +0100, Peter Oberndorfer wrote:

> "git repo-config" will be removed soon
>
> Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>

Thanks, I'll apply this tonight. (Along with Pavel's "stg edit --sign"
patch, which I've been neglecting for quite a while now. Sorry!)

> since i am not good at creating log messages, feel free to change it :-)

I'm going to end the commit message body sentence with a period, but
otherwise it's totally OK.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-16 21:13     ` Jakub Narebski
  2008-01-16 21:46       ` Peter Oberndorfer
@ 2008-01-17 17:07       ` Catalin Marinas
  2008-01-17 23:49         ` Jakub Narebski
  1 sibling, 1 reply; 21+ messages in thread
From: Catalin Marinas @ 2008-01-17 17:07 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Peter Oberndorfer, Karl Hasselström, Dan McGee, git

Hi,

Now I'm back from holiday and I'll start merging patches. Thanks for the fixes.

On 16/01/2008, Jakub Narebski <jnareb@gmail.com> wrote:
> Strange that StGIT didn't abstracted out reading git config, like
> Git.pm and gitweb.perl did.

The initial implementation was to use Python to parse the config file
but it was dropped in favour of the git-config tool. It might be a bit
slower but, at least, we don't need to follow any future syntax
changes.

> BTW. will StGIT be using libgit-thin + PyGit, or is it not ready yet?

The last commit to the libgit project seems to be in August 2007. Is
it still maintained? If GIT will provide a stable API and library, we
might use it but I don't think it would bring a great performance
improvement. Most of the time, in my case, seems to be spent in calls
list git-diff-tree. A few tens of milliseconds avoided by not calling
an external tool would be unnoticed.

-- 
Catalin

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-17 17:07       ` Catalin Marinas
@ 2008-01-17 23:49         ` Jakub Narebski
  0 siblings, 0 replies; 21+ messages in thread
From: Jakub Narebski @ 2008-01-17 23:49 UTC (permalink / raw)
  To: Catalin Marinas, Peter Oberndorfer; +Cc: Karl Hasselström, Dan McGee, git

On Thu, 17 January 2008, Catalin Marinas wrote:
>
> Now I'm back from holiday and I'll start merging patches.
> Thanks for the fixes. 
> 
> On 16/01/2008, Jakub Narebski <jnareb@gmail.com> wrote:
> > Strange that StGIT didn't abstracted out reading git config, like
> > Git.pm and gitweb.perl did.
> 
> The initial implementation was to use Python to parse the config file
> but it was dropped in favour of the git-config tool. It might be a bit
> slower but, at least, we don't need to follow any future syntax
> changes.

Errr... this is not what I meant. What I meant here is why StGit doesn't
have a thin wrapper around "git config", so instead of all those calls
to "Run('git', 'config', '--get', name)" use "git_config(name)" etc.,
similarly to Git.pm and gitweb.perl (which also use git-config to parse
the config file; only git-cvsimport parses config file in Perl IIRC).

This way if you want to load the whole config file at once (like gitweb
now does, using "git config -z -l") you would have to make changes only
in one place.

-- 
Jakub Narebski
Poland

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-17  7:45     ` Karl Hasselström
@ 2008-01-18  4:24       ` Karl Hasselström
  2008-01-23 11:35         ` Catalin Marinas
  0 siblings, 1 reply; 21+ messages in thread
From: Karl Hasselström @ 2008-01-18  4:24 UTC (permalink / raw)
  To: Peter Oberndorfer; +Cc: git, Catalin Marinas, Pavel Roskin

On 2008-01-17 08:45:59 +0100, Karl Hasselström wrote:

> Thanks, I'll apply this tonight. (Along with Pavel's "stg edit --sign"
> patch, which I've been neglecting for quite a while now. Sorry!)

The following changes since commit 5b2666bab799830ac5e511f35103d04fc3968b32:
  Catalin Marinas (1):
        Remove a newline from the e-mail template

are available in the git repository at:

  git://repo.or.cz/stgit/kha.git safe

David Kågedal (2):
      Emacs mode: Add mark command
      Emacs mode: coalesce command

Karl Hasselström (12):
      Teach the new infrastructure about the index and worktree
      Let "stg clean" use the new transaction primitives
      Let "stg goto" use the new infrastructure
      Convert "stg uncommit" to the new infrastructure
      New infrastructure: Make sure that the branch is initialized
      Expose transaction abort function
      stg coalesce: Support --file and --save-template
      Set exit code to 3 on merge conflict
      Convert "stg commit" to new infrastructure
      Make "stg commit" fancier
      Test that "stg goto" can be called from a subdirectory
      Make "stg goto" subdirectory safe

Pavel Roskin (1):
      Fix "stg edit --sign"

Peter Oberndorfer (2):
      Don't mention removed "stg refresh" options
      replace "git repo-config" usage by "git config"

 contrib/stgit.el              |   97 ++++++++++++++++++-----
 stgit/commands/clean.py       |   35 ++------
 stgit/commands/coalesce.py    |  118 ++++++++++++++++++---------
 stgit/commands/commit.py      |  111 ++++++++++++++++----------
 stgit/commands/edit.py        |    5 +-
 stgit/commands/goto.py        |   52 ++++--------
 stgit/commands/refresh.py     |    8 +-
 stgit/commands/uncommit.py    |   81 ++++++++-----------
 stgit/config.py               |   14 ++--
 stgit/lib/git.py              |  128 +++++++++++++++++++++++++++++
 stgit/lib/stack.py            |   10 ++-
 stgit/lib/stackupgrade.py     |    6 +-
 stgit/lib/transaction.py      |  178 +++++++++++++++++++++++++++++++++++------
 stgit/main.py                 |    4 +-
 stgit/run.py                  |    9 ++-
 stgit/utils.py                |    1 +
 t/t1300-uncommit.sh           |   12 ++--
 t/t1900-mail.sh               |    2 +-
 t/t2100-pull-policy-fetch.sh  |    4 +-
 t/t2101-pull-policy-pull.sh   |    4 +-
 t/t2102-pull-policy-rebase.sh |    4 +-
 t/t2800-goto-subdir.sh        |   59 ++++++++++++++
 22 files changed, 675 insertions(+), 267 deletions(-)
 create mode 100755 t/t2800-goto-subdir.sh

                                  -+-

The following changes since commit 085902b45b9bea3fa5bc14470219891ec4ccba78:
  Peter Oberndorfer (1):
        replace "git repo-config" usage by "git config"

are available in the git repository at:

  git://repo.or.cz/stgit/kha.git experimental

Peter Oberndorfer (1):
      Add an --index option to "stg refresh"

 stgit/commands/refresh.py |   25 ++++++++++++++++---
 t/t2700-refresh.sh        |   57 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 77 insertions(+), 5 deletions(-)

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-18  4:24       ` Karl Hasselström
@ 2008-01-23 11:35         ` Catalin Marinas
  2008-01-23 16:10           ` Karl Hasselström
  0 siblings, 1 reply; 21+ messages in thread
From: Catalin Marinas @ 2008-01-23 11:35 UTC (permalink / raw)
  To: Karl Hasselström; +Cc: Peter Oberndorfer, git, Pavel Roskin

Hi Karl,

On 18/01/2008, Karl Hasselström <kha@treskal.com> wrote:
> The following changes since commit 5b2666bab799830ac5e511f35103d04fc3968b32:
>   Catalin Marinas (1):
>         Remove a newline from the e-mail template
>
> are available in the git repository at:
>
>   git://repo.or.cz/stgit/kha.git safe
[...]
>       Teach the new infrastructure about the index and worktree
>       Let "stg clean" use the new transaction primitives
>       Let "stg goto" use the new infrastructure

I merged your patches but I have some wishes. Could we keep pretty
much the same reporting messages? For example, pushing reports a
conflict but it no longer lists which files conflicted. The 'goto'
checks the local status before pushing but doesn't report this (and my
machine is slow and it might wait even 20 seconds or more, it is
useful to get some messages).

The pop/push commands report that the action took place. The one with
"action ... done" was friendlier I think, especially with the 'pop'
command reporting that it popped the patches but it waits quite a lot
before returning.

Thanks.

-- 
Catalin

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-23 11:35         ` Catalin Marinas
@ 2008-01-23 16:10           ` Karl Hasselström
  2008-01-23 16:42             ` Catalin Marinas
  0 siblings, 1 reply; 21+ messages in thread
From: Karl Hasselström @ 2008-01-23 16:10 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: Peter Oberndorfer, git, Pavel Roskin

On 2008-01-23 11:35:03 +0000, Catalin Marinas wrote:

> On 18/01/2008, Karl Hasselström <kha@treskal.com> wrote:
>
> > The following changes since commit
> > 5b2666bab799830ac5e511f35103d04fc3968b32:
>
> I merged your patches but I have some wishes. Could we keep pretty
> much the same reporting messages? For example, pushing reports a
> conflict but it no longer lists which files conflicted.

Mmm, that's a regression. Will try to see where that got lost.

> The 'goto' checks the local status before pushing but doesn't report
> this (and my machine is slow and it might wait even 20 seconds or
> more, it is useful to get some messages).

No, it doesn't anymore, so it should be faster than before. Instead of
checking the entire tree for cleanliness, it just relies on
git-read-tree -u -m to abort without changes if any of the files that
need updating are dirty.

This goes for all commands using the new infrastructure, by the way.
They share a _lot_ of code.

> The pop/push commands report that the action took place. The one
> with "action ... done" was friendlier I think, especially with the
> 'pop' command reporting that it popped the patches but it waits
> quite a lot before returning.

Yes, I agree that the current output is not optimal.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-23 16:10           ` Karl Hasselström
@ 2008-01-23 16:42             ` Catalin Marinas
  2008-01-24  7:01               ` Karl Hasselström
  0 siblings, 1 reply; 21+ messages in thread
From: Catalin Marinas @ 2008-01-23 16:42 UTC (permalink / raw)
  To: Karl Hasselström; +Cc: Peter Oberndorfer, git, Pavel Roskin

On 23/01/2008, Karl Hasselström <kha@treskal.com> wrote:
> On 2008-01-23 11:35:03 +0000, Catalin Marinas wrote:
> > The 'goto' checks the local status before pushing but doesn't report
> > this (and my machine is slow and it might wait even 20 seconds or
> > more, it is useful to get some messages).
>
> No, it doesn't anymore, so it should be faster than before. Instead of
> checking the entire tree for cleanliness, it just relies on
> git-read-tree -u -m to abort without changes if any of the files that
> need updating are dirty.

Ah, OK. BTW, even if the tree was clean, a 'goto' failed on my Linux
tree earlier today with the following message:

$ stg goto realview-eb-header
Popped realview-pb1176 -- realview-ioaddress
fatal: Entry 'arch/arm/mach-realview/realview_pb11mp.c' not uptodate.
Cannot merge.
stg goto: Command aborted (all changes rolled back)

It worked fine after running 'stg status' once (and not showing any
changes). In the old GIT interface, we use to call refresh_index (i.e.
'git update-index -q --unmerged --refresh'). Does this still happen?

The message above also shows what I meant with messages not being very
clear. It reports "Popped" but actually failed. Showing "Popping ...
done" would be better.

-- 
Catalin

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-23 16:42             ` Catalin Marinas
@ 2008-01-24  7:01               ` Karl Hasselström
  2008-01-24 15:31                 ` Catalin Marinas
  0 siblings, 1 reply; 21+ messages in thread
From: Karl Hasselström @ 2008-01-24  7:01 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: Peter Oberndorfer, git, Pavel Roskin

On 2008-01-23 16:42:41 +0000, Catalin Marinas wrote:

> On 23/01/2008, Karl Hasselström <kha@treskal.com> wrote:
>
> > On 2008-01-23 11:35:03 +0000, Catalin Marinas wrote:
> >
> > > The 'goto' checks the local status before pushing
> >
> > No, it doesn't anymore
>
> Ah, OK. BTW, even if the tree was clean, a 'goto' failed on my Linux
> tree earlier today with the following message:
>
> $ stg goto realview-eb-header
> Popped realview-pb1176 -- realview-ioaddress
> fatal: Entry 'arch/arm/mach-realview/realview_pb11mp.c' not uptodate.
> Cannot merge.
> stg goto: Command aborted (all changes rolled back)
>
> It worked fine after running 'stg status' once (and not showing any
> changes). In the old GIT interface, we use to call refresh_index (i.e.
> 'git update-index -q --unmerged --refresh'). Does this still happen?

Ah, no, I guess it doesn't. And I guess it should. We should probably
have a test for that ...

> The message above also shows what I meant with messages not being
> very clear. It reports "Popped" but actually failed. Showing
> "Popping ... done" would be better.

Not necessarily. Even with the latter message style, you'd sometimes
get sequences like this:

  Popping p3 -- p1 ... done
  Pushing p4 ... done
  Pushing p5 ... done
  fatal: Entry 'some/annoying/file' not uptodate.
  Cannot merge.
  stg cool-command: Command aborted (all changes rolled back)

That is, the sequence of pushes and pops succeeded, but the changes
were still rolled back due to a dirty worktree.

Now, this doesn't mean I don't agree with you about the "done"
messages -- they serve as a kind of progress bar -- but just because
it says "done" doesn't mean the change will still be in effect when
the command returns.

And there should probably be an explicit "Checking out files ... done"
stage when we run git-read-tree, since that tends to take relatively
much time.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-24  7:01               ` Karl Hasselström
@ 2008-01-24 15:31                 ` Catalin Marinas
  2008-01-24 18:08                   ` Karl Hasselström
  0 siblings, 1 reply; 21+ messages in thread
From: Catalin Marinas @ 2008-01-24 15:31 UTC (permalink / raw)
  To: Karl Hasselström; +Cc: Peter Oberndorfer, git, Pavel Roskin

On 24/01/2008, Karl Hasselström <kha@treskal.com> wrote:
> On 2008-01-23 16:42:41 +0000, Catalin Marinas wrote:
> > $ stg goto realview-eb-header
> > Popped realview-pb1176 -- realview-ioaddress
> > fatal: Entry 'arch/arm/mach-realview/realview_pb11mp.c' not uptodate.
> > Cannot merge.
> > stg goto: Command aborted (all changes rolled back)
> >
> > It worked fine after running 'stg status' once (and not showing any
> > changes). In the old GIT interface, we use to call refresh_index (i.e.
> > 'git update-index -q --unmerged --refresh'). Does this still happen?
>
> Ah, no, I guess it doesn't. And I guess it should. We should probably
> have a test for that ...

Yes.

Another thing, can the '--keep' option be added? Can it work with the
new structure? I use it quite often as I make some minor modification
and I'd like to pop patches without affecting the local changes.

> And there should probably be an explicit "Checking out files ... done"
> stage when we run git-read-tree, since that tends to take relatively
> much time.

Yes, that would be useful as well.

-- 
Catalin

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-24 15:31                 ` Catalin Marinas
@ 2008-01-24 18:08                   ` Karl Hasselström
  2008-01-24 18:20                     ` Catalin Marinas
  0 siblings, 1 reply; 21+ messages in thread
From: Karl Hasselström @ 2008-01-24 18:08 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: Peter Oberndorfer, git, Pavel Roskin

On 2008-01-24 15:31:40 +0000, Catalin Marinas wrote:

> Another thing, can the '--keep' option be added? Can it work with
> the new structure? I use it quite often as I make some minor
> modification and I'd like to pop patches without affecting the local
> changes.

As is, it works out of the box as long as your local changes are in
files not touched by the command.

Making it work in other cases as well should be doable -- behind the
scenes, we'd save the local changes much like a patch, and try to
apply it at the end. (In fact, we should probably not create this
"patch" until git-read-tree tells us it can't do its job due to local
changes.)

Adding the --keep flag once would make it available for all commands
using the new infrastructure.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

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

* Re: [STGIT PATCH] replace "git repo-config" usage by "git config"
  2008-01-24 18:08                   ` Karl Hasselström
@ 2008-01-24 18:20                     ` Catalin Marinas
  0 siblings, 0 replies; 21+ messages in thread
From: Catalin Marinas @ 2008-01-24 18:20 UTC (permalink / raw)
  To: Karl Hasselström; +Cc: Peter Oberndorfer, git, Pavel Roskin

On 24/01/2008, Karl Hasselström <kha@treskal.com> wrote:
> On 2008-01-24 15:31:40 +0000, Catalin Marinas wrote:
>
> > Another thing, can the '--keep' option be added? Can it work with
> > the new structure? I use it quite often as I make some minor
> > modification and I'd like to pop patches without affecting the local
> > changes.
>
> As is, it works out of the box as long as your local changes are in
> files not touched by the command.

It used to work in this case as well :-).

> Making it work in other cases as well should be doable -- behind the
> scenes, we'd save the local changes much like a patch, and try to
> apply it at the end. (In fact, we should probably not create this
> "patch" until git-read-tree tells us it can't do its job due to local
> changes.)

My simple approach was to apply the cumulated diff of the patches to
be popped in reverse (and change the top of the stack). If there are
no conflicts, it works just fine. If it cannot do this, there might be
conflicts and I create a temporary patch manually. Merging that patch
would probably lead to conflicts needing to be solved.

For the push operation, we try the diff applying followed by a
three-way merge if the former fails. We could do something similar
with the pop operation for keeping the local changes - try the
reversed diff or create a temporary patch automatically.

But, I'd really like for this not to be enabled by default. I might
forget to refresh a patch and will go to another just to realise that
there are uncommitted changes, hence the "check_local_changes()" call
for most of the commands affecting the stack.

-- 
Catalin

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

end of thread, other threads:[~2008-01-24 18:20 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-16  3:19 [RFC/PATCH] Remove repo-config Dan McGee
2008-01-16  4:23 ` Junio C Hamano
2008-01-16  4:40   ` Dan McGee
2008-01-16 17:20     ` Junio C Hamano
2008-01-16 20:32       ` Junio C Hamano
2008-01-16 20:13 ` Junio C Hamano
2008-01-16 20:47 ` Peter Oberndorfer
2008-01-16 20:58   ` [STGIT PATCH] replace "git repo-config" usage by "git config" Peter Oberndorfer
2008-01-16 21:13     ` Jakub Narebski
2008-01-16 21:46       ` Peter Oberndorfer
2008-01-17 17:07       ` Catalin Marinas
2008-01-17 23:49         ` Jakub Narebski
2008-01-17  7:45     ` Karl Hasselström
2008-01-18  4:24       ` Karl Hasselström
2008-01-23 11:35         ` Catalin Marinas
2008-01-23 16:10           ` Karl Hasselström
2008-01-23 16:42             ` Catalin Marinas
2008-01-24  7:01               ` Karl Hasselström
2008-01-24 15:31                 ` Catalin Marinas
2008-01-24 18:08                   ` Karl Hasselström
2008-01-24 18:20                     ` Catalin Marinas

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