Git development
 help / color / mirror / Atom feed
* Re: jn/shell-disable-interactive (Re: What's cooking in git.git (Feb 2013, #05; Tue, 12))
From: Junio C Hamano @ 2013-02-13  0:15 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git
In-Reply-To: <20130213001213.GA15246@google.com>

Jonathan Nieder <jrnieder@gmail.com> writes:

> Junio C Hamano wrote:
>
>> * jn/shell-disable-interactive (2013-02-11) 2 commits
>>  - shell: pay attention to exit status from 'help' command
>>  - shell doc: emphasize purpose and security model
>>
>>  Will merge to 'next'.
>
> Please hold off on merging the second patch.  I'd like to reroll
> renaming the command to 'no-interactive-login' or some such, which
> would be less disruptive to existing setups and should be easier to
> explain.

Thanks; that sounds like a sensible and safer change.

^ permalink raw reply

* jn/shell-disable-interactive (Re: What's cooking in git.git (Feb 2013, #05; Tue, 12))
From: Jonathan Nieder @ 2013-02-13  0:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7v621xdql8.fsf@alter.siamese.dyndns.org>

Junio C Hamano wrote:

> * jn/shell-disable-interactive (2013-02-11) 2 commits
>  - shell: pay attention to exit status from 'help' command
>  - shell doc: emphasize purpose and security model
>
>  Will merge to 'next'.

Please hold off on merging the second patch.  I'd like to reroll
renaming the command to 'no-interactive-login' or some such, which
would be less disruptive to existing setups and should be easier to
explain.

Thanks,
Jonathan

^ permalink raw reply

* What's cooking in git.git (Feb 2013, #05; Tue, 12)
From: Junio C Hamano @ 2013-02-13  0:06 UTC (permalink / raw)
  To: git

Here are the topics that have been cooking.  Commits prefixed with
'-' are only in 'pu' (proposed updates) while commits prefixed with
'+' are in 'next'.

A preview of the upcoming release 1.8.2-rc0 is expected to be tagged
late this week.

You can find the changes described here in the integration branches of the
repositories listed at

    http://git-blame.blogspot.com/p/git-public-repositories.html

--------------------------------------------------
[Graduated to "master"]

* sp/smart-http-content-type-check (2013-02-06) 3 commits
  (merged to 'next' on 2013-02-06 at 8bc6434)
 + http_request: reset "type" strbuf before adding
  (merged to 'next' on 2013-02-05 at 157812c)
 + t5551: fix expected error output
  (merged to 'next' on 2013-02-04 at d0759cb)
 + Verify Content-Type from smart HTTP servers

 The smart HTTP clients forgot to verify the content-type that comes
 back from the server side to make sure that the request is being
 handled properly.

--------------------------------------------------
[New Topics]

* da/p4merge-mktemp-fix (2013-02-10) 1 commit
 - p4merge: fix printf usage

 Will merge to 'next'.


* jn/shell-disable-interactive (2013-02-11) 2 commits
 - shell: pay attention to exit status from 'help' command
 - shell doc: emphasize purpose and security model

 Will merge to 'next'.


* jk/read-commit-buffer-data-after-free (2013-02-11) 1 commit
 - log: re-encode commit messages before grepping

 Will merge to 'next'.


* mk/old-expat (2013-02-11) 1 commit
 - Allow building with xmlparse.h

 Will merge to 'next'.


* ef/non-ascii-parse-options-error-diag (2013-02-11) 1 commit
 - parse-options: report uncorrupted multi-byte options

 Will merge to 'next'.


* jk/rebase-i-comment-char (2013-02-12) 1 commit
 - rebase -i: respect core.commentchar

 Will merge to 'next'.


* mm/config-local-completion (2013-02-12) 1 commit
 - completion: support 'git config --local'

 Will merge to 'next'.

--------------------------------------------------
[Stalled]

* mp/diff-algo-config (2013-01-16) 3 commits
 - diff: Introduce --diff-algorithm command line option
 - config: Introduce diff.algorithm variable
 - git-completion.bash: Autocomplete --minimal and --histogram for git-diff

 Add diff.algorithm configuration so that the user does not type
 "diff --histogram".

 Looking better; may want tests to protect it from future breakages,
 but otherwise it looks ready for 'next'.

 Expecting a follow-up to add tests.


* mb/gitweb-highlight-link-target (2012-12-20) 1 commit
 - Highlight the link target line in Gitweb using CSS

 Expecting a reroll.
 $gmane/211935


* jk/lua-hackery (2012-10-07) 6 commits
 - pretty: fix up one-off format_commit_message calls
 - Minimum compilation fixup
 - Makefile: make "lua" a bit more configurable
 - add a "lua" pretty format
 - add basic lua infrastructure
 - pretty: make some commit-parsing helpers more public

 Interesting exercise. When we do this for real, we probably would want
 to wrap a commit to make it more like an "object" with methods like
 "parents", etc.


* rc/maint-complete-git-p4 (2012-09-24) 1 commit
 - Teach git-completion about git p4

 Comment from Pete will need to be addressed ($gmane/206172).


* jc/maint-name-rev (2012-09-17) 7 commits
 - describe --contains: use "name-rev --algorithm=weight"
 - name-rev --algorithm=weight: tests and documentation
 - name-rev --algorithm=weight: cache the computed weight in notes
 - name-rev --algorithm=weight: trivial optimization
 - name-rev: --algorithm option
 - name_rev: clarify the logic to assign a new tip-name to a commit
 - name-rev: lose unnecessary typedef

 "git name-rev" names the given revision based on a ref that can be
 reached in the smallest number of steps from the rev, but that is
 not useful when the caller wants to know which tag is the oldest one
 that contains the rev.  This teaches a new mode to the command that
 uses the oldest ref among those which contain the rev.

 I am not sure if this is worth it; for one thing, even with the help
 from notes-cache, it seems to make the "describe --contains" even
 slower. Also the command will be unusably slow for a user who does
 not have a write access (hence unable to create or update the
 notes-cache).

 Stalled mostly due to lack of responses.


* jc/xprm-generation (2012-09-14) 1 commit
 - test-generation: compute generation numbers and clock skews

 A toy to analyze how bad the clock skews are in histories of real
 world projects.

 Stalled mostly due to lack of responses.


* jc/add-delete-default (2012-08-13) 1 commit
 - git add: notice removal of tracked paths by default

 "git add dir/" updated modified files and added new files, but does
 not notice removed files, which may be "Huh?" to some users.  They
 can of course use "git add -A dir/", but why should they?

 Resurrected from graveyard, as I thought it was a worthwhile thing
 to do in the longer term.

 Stalled mostly due to lack of responses.


* mb/remote-default-nn-origin (2012-07-11) 6 commits
 - Teach get_default_remote to respect remote.default.
 - Test that plain "git fetch" uses remote.default when on a detached HEAD.
 - Teach clone to set remote.default.
 - Teach "git remote" about remote.default.
 - Teach remote.c about the remote.default configuration setting.
 - Rename remote.c's default_remote_name static variables.

 When the user does not specify what remote to interact with, we
 often attempt to use 'origin'.  This can now be customized via a
 configuration variable.

 Expecting a reroll.
 $gmane/210151

 "The first remote becomes the default" bit is better done as a
 separate step.

--------------------------------------------------
[Cooking]

* jc/fetch-raw-sha1 (2013-02-07) 4 commits
 - fetch: fetch objects by their exact SHA-1 object names
 - upload-pack: optionally allow fetching from the tips of hidden refs
 - fetch: use struct ref to represent refs to be fetched
 - parse_fetch_refspec(): clarify the codeflow a bit
 (this branch uses jc/hidden-refs.)

 Allows requests to fetch objects at any tip of refs (including
 hidden ones).  It seems that there may be use cases even outside
 Gerrit (e.g. $gmane/215701).


* jk/diff-graph-cleanup (2013-02-12) 6 commits
  (merged to 'next' on 2013-02-12 at 6e764c1)
 + combine-diff.c: teach combined diffs about line prefix
 + diff.c: use diff_line_prefix() where applicable
 + diff: add diff_line_prefix function
 + diff.c: make constant string arguments const
 + diff: write prefix to the correct file
 + graph: output padding for merge subsequent parents

 Refactors a lot of repetitive code sequence from the graph drawing
 code and adds it to the combined diff output.

 Will merge to 'master'.


* mn/send-email-works-with-credential (2013-02-12) 6 commits
 - git-send-email: use git credential to obtain password
 - Git.pm: add interface for git credential command
 - Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe
 - Git.pm: refactor command_close_bidi_pipe to use _cmd_close
 - Git.pm: fix example in command_close_bidi_pipe documentation
 - Git.pm: allow command_close_bidi_pipe to be called as method

 Hooks the credential system to send-email.
 Rerolled.
 Waiting for a review.


* tz/perl-styles (2013-02-06) 1 commit
  (merged to 'next' on 2013-02-09 at c8cff17)
 + Update CodingGuidelines for Perl

 Add coding guidelines for writing Perl scripts for Git.

 Will merge to 'master'.


* al/mergetool-printf-fix (2013-02-10) 2 commits
  (merged to 'next' on 2013-02-11 at 5f9bc4e)
 + difftool--helper: fix printf usage
 + git-mergetool: print filename when it contains %

 Will merge to 'master'.


* jk/error-const-return (2013-02-08) 1 commit
  (merged to 'next' on 2013-02-11 at ba8dba3)
 + Use __VA_ARGS__ for all of error's arguments

 Will merge to 'master'.


* mm/remote-mediawiki-build (2013-02-08) 2 commits
  (merged to 'next' on 2013-02-11 at 4ebb902)
 + git-remote-mediawiki: use toplevel's Makefile
 + Makefile: make script-related rules usable from subdirectories

 Will merge to 'master'.


* nd/branch-show-rebase-bisect-state (2013-02-08) 1 commit
 - branch: show rebase/bisect info when possible instead of "(no branch)"

 Expecting a reroll.
 $gmane/215771


* nd/count-garbage (2013-02-08) 3 commits
 - count-objects: report how much disk space taken by garbage files
 - count-objects: report garbage files in pack directory too
 - git-count-objects.txt: describe each line in -v output

 Expecting a reroll.
 $gmane/216127


* wk/man-deny-current-branch-is-default-these-days (2013-02-08) 1 commit
 - user-manual: Update for receive.denyCurrentBranch=refuse

 Will merge to 'next'.


* bw/get-tz-offset-perl (2013-02-09) 3 commits
  (merged to 'next' on 2013-02-11 at b9c8893)
 + cvsimport: format commit timestamp ourselves without using strftime
 + perl/Git.pm: fix get_tz_offset to properly handle DST boundary cases
 + Move Git::SVN::get_tz to Git::get_tz_offset

 Will merge to 'master'.


* mg/bisect-doc (2013-02-11) 1 commit
  (merged to 'next' on 2013-02-11 at 6125304)
 + git-bisect.txt: clarify that reset quits bisect

 Will merge to 'master'.


* jc/extended-fake-ancestor-for-gitlink (2013-02-05) 1 commit
  (merged to 'next' on 2013-02-09 at 2d3547b)
 + apply: verify submodule commit object name better

 Instead of requiring the full 40-hex object names on the index
 line, we can read submodule commit object names from the textual
 diff when synthesizing a fake ancestore tree for "git am -3".

 Will merge to 'master'.


* tz/credential-authinfo (2013-02-05) 1 commit
 - Add contrib/credentials/netrc with GPG support

 A new read-only credential helper (in contrib/) to interact with
 the .netrc/.authinfo files.  Hopefully mn/send-email-authinfo topic
 can rebuild on top of something like this.

 Expecting a reroll.
 $gmane/215556


* jx/utf8-printf-width (2013-02-11) 1 commit
  (merged to 'next' on 2013-02-11 at 968b4e2)
 + Add utf8_fprintf helper that returns correct number of columns

 Use a new helper that prints a message and counts its display width
 to align the help messages parse-options produces.

 Will merge to 'master'.


* dg/subtree-fixes (2013-02-05) 6 commits
  (merged to 'next' on 2013-02-09 at 8f19ebe)
 + contrib/subtree: make the manual directory if needed
 + contrib/subtree: honor DESTDIR
 + contrib/subtree: fix synopsis
 + contrib/subtree: better error handling for 'subtree add'
 + contrib/subtree: use %B for split subject/body
 + contrib/subtree: remove test number comments

 contrib/subtree updates, but here are only the ones that looked
 ready to be merged to 'next'.  For the remainder, they will have
 another day.

 Will merge to 'master'.


* jl/submodule-deinit (2013-02-06) 1 commit
 - submodule: add 'deinit' command

 There was no Porcelain way to say "I no longer am interested in
 this submodule", once you express your interest in a submodule with
 "submodule init".  "submodule deinit" is the way to do so.

 Will merge to 'next'.


* jc/remove-export-from-config-mak-in (2013-02-12) 2 commits
  (merged to 'next' on 2013-02-12 at eb8af04)
 + Makefile: do not export mandir/htmldir/infodir
  (merged to 'next' on 2013-02-07 at 33f7d4f)
 + config.mak.in: remove unused definitions

 config.mak.in template had an "export" line to cause a few
 common makefile variables to be exported; if they need to be
 expoted for autoconf/configure users, they should also be exported
 for people who write config.mak the same way.  Move the "export" to
 the main Makefile.  Also, stop exporting mandir that used to be
 exported (only) when config.mak.autogen was used.  It would have
 broken installation of manpages (but not other documentation
 formats).


* nd/status-show-in-progress (2013-02-05) 1 commit
  (merged to 'next' on 2013-02-11 at 5ffcbc2)
 + status: show the branch name if possible in in-progress info

 Will merge to 'master'.


* jc/mention-tracking-for-pull-default (2013-01-31) 1 commit
 - doc: mention tracking for pull.default

 We stopped mentioning `tracking` is a deprecated but supported
 synonym for `upstream` in pull.default even though we have no
 intention of removing the support for it.

 This is my "don't list it to catch readers' eyes, but make sure it
 can be found if the reader looks for it" version; I'm not married
 to the layout and will be happy to take a replacement patch.

 Will merge to 'next', unless a replacement materializes soonish.


* jc/hidden-refs (2013-02-07) 3 commits
 - upload/receive-pack: allow hiding ref hierarchies
 - upload-pack: simplify request validation
 - upload-pack: share more code
 (this branch is used by jc/fetch-raw-sha1.)

 Allow the server side to redact the refs/ namespace it shows to the
 client.

 Will merge to 'next'.


* jc/remove-treesame-parent-in-simplify-merges (2013-01-17) 1 commit
  (merged to 'next' on 2013-01-30 at b639b47)
 + simplify-merges: drop merge from irrelevant side branch

 The --simplify-merges logic did not cull irrelevant parents from a
 merge that is otherwise not interesting with respect to the paths
 we are following.

 This touches a fairly core part of the revision traversal
 infrastructure; even though I think this change is correct, please
 report immediately if you find any unintended side effect.

 Will cook in 'next'.


* jc/push-2.0-default-to-simple (2013-01-16) 14 commits
  (merged to 'next' on 2013-01-16 at 23f5df2)
 + t5570: do not assume the "matching" push is the default
 + t5551: do not assume the "matching" push is the default
 + t5550: do not assume the "matching" push is the default
  (merged to 'next' on 2013-01-09 at 74c3498)
 + doc: push.default is no longer "matching"
 + push: switch default from "matching" to "simple"
 + t9401: do not assume the "matching" push is the default
 + t9400: do not assume the "matching" push is the default
 + t7406: do not assume the "matching" push is the default
 + t5531: do not assume the "matching" push is the default
 + t5519: do not assume the "matching" push is the default
 + t5517: do not assume the "matching" push is the default
 + t5516: do not assume the "matching" push is the default
 + t5505: do not assume the "matching" push is the default
 + t5404: do not assume the "matching" push is the default

 Will cook in 'next' until Git 2.0 ;-).


* bc/append-signed-off-by (2013-02-12) 12 commits
 - Unify appending signoff in format-patch, commit and sequencer
 - format-patch: update append_signoff prototype
 - t4014: more tests about appending s-o-b lines
 - sequencer.c: teach append_signoff to avoid adding a duplicate newline
 - sequencer.c: teach append_signoff how to detect duplicate s-o-b
 - sequencer.c: always separate "(cherry picked from" from commit body
 - sequencer.c: require a conforming footer to be preceded by a blank line
 - sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footer
 - t/t3511: add some tests of 'cherry-pick -s' functionality
 - t/test-lib-functions.sh: allow to specify the tag name to test_commit
 - commit, cherry-pick -s: remove broken support for multiline rfc2822 fields
 - sequencer.c: rework search for start of footer to improve clarity

 Will merge to 'next'.

--------------------------------------------------
[Discarded]

* mn/send-email-authinfo (2013-01-29) 1 commit
 . git-send-email: add ~/.authinfo parsing

 Instead of making send-email directly read from .netrc/.authinfo,
 mn/send-email-works-with-credential topic hooks the program to our
 credential framework, and tz/credential-authinfo topic gives access
 to these file formats to credential consumers.


* mm/allow-contrib-build (2013-02-07) 2 commits
 . perl.mak: introduce $(GIT_ROOT_DIR) to allow inclusion from other directories
 . Makefile: extract perl-related rules to make them available from other dirs

 Superseded by mm/remote-mediawiki-build.

^ permalink raw reply

* Re: [PATCH] completion: support 'git config --local'
From: Jeff King @ 2013-02-13  0:05 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Matthieu Moy, git, Dasa Paddock
In-Reply-To: <7v1uclfafi.fsf@alter.siamese.dyndns.org>

On Tue, Feb 12, 2013 at 02:13:05PM -0800, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > I'm not sure I understand the original poster's point about "git config
> > -l --local". "-l" does not take a limiter, does it?
> 
> "git config -l core.\*" will just die without limiting the output to
> everything under core. hierarchy, so you are right---the combination
> does not make any sense.  You have to say
> 
>     git config -l | grep ^core\\.
> 
> or something like that.
> 
> Completing "git config -l --lo<TAB>" still may help, though.

Ah, I think I see Dasa's original point now. He was interested in fixing
"--lo<TAB>" to complete "--local". But the line he pointed to in his
original message is not the right place for that; it is the site of an
unrelated spot which should _also_ be fixed to use "--local", but for a
different reason (restricting the variables suggested for "--local --get
<TAB>" properly).

So yeah. Matthieu's patch is the right thing to do, as it covers both
(mine fixed only half of it).

-Peff

^ permalink raw reply

* [PATCH 4/4] contrib/subtree: update documentation
From: Paul Campbell @ 2013-02-12 23:24 UTC (permalink / raw)
  To: git; +Cc: David A. Greene, Michael Schubert

>From 483a644fb40d14f2209116c45c1cb6beab11a181 Mon Sep 17 00:00:00 2001
From: Paul Campbell <pcampbell@kemitix.net>
Date: Tue, 12 Feb 2013 00:07:26 +0000
Subject: [PATCH 4/4] contrib/subtree: update documentation

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.txt | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt
index c5bce41..67dea3f 100644
--- a/contrib/subtree/git-subtree.txt
+++ b/contrib/subtree/git-subtree.txt
@@ -10,8 +10,8 @@ SYNOPSIS
 --------
 [verse]
 'git subtree' add   -P <prefix> <commit>
-'git subtree' pull  -P <prefix> <repository> <refspec...>
-'git subtree' push  -P <prefix> <repository> <refspec...>
+'git subtree' pull  -P <prefix> [<repository> <refspec...>]
+'git subtree' push  -P <prefix> [<repository> <refspec...>]
 'git subtree' merge -P <prefix> <commit>
 'git subtree' split -P <prefix> [OPTIONS] [<commit>]

@@ -71,7 +71,9 @@ add::
 	A new commit is created	automatically, joining the imported
 	project's history with your own.  With '--squash', imports
 	only a single commit from the subproject, rather than its
-	entire history.
+	entire history. Details of the <prefix> are added to the
+	.gitsubtree file, where they will be used as defaults for
+	'push' and 'pull'.

 merge::
 	Merge recent changes up to <commit> into the <prefix>
@@ -90,13 +92,16 @@ merge::
 pull::
 	Exactly like 'merge', but parallels 'git pull' in that
 	it fetches the given commit from the specified remote
-	repository.
+	repository. Default values for <repository> and <refspec>
+	are taken from the .gitsubtree file.
 	
 push::
 	Does a 'split' (see below) using the <prefix> supplied
 	and then does a 'git push' to push the result to the
 	repository and refspec. This can be used to push your
 	subtree to different branches of the remote repository.
+	Default values for <repository> and <refspec> are taken
+	from the .gitsubtree file.

 split::
 	Extract a new, synthetic project history from the
-- 
1.8.1.3.566.gaa39828

^ permalink raw reply related

* [PATCH 3/4] contrib/subtree/t: Added tests for .gitsubtree support
From: Paul Campbell @ 2013-02-12 23:23 UTC (permalink / raw)
  To: git; +Cc: David A. Greene, Michael Schubert

 55 add: ensure details are added to .gitsubtree
 56 push: check for a SHA1 update line
 57 pull: add a file on one subtree, push it to a branch, then pull into
    another subtree containing the same branch and confirm the files match
 58 add: ensure stale .gitsubtree entry is replaced

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/t/t7900-subtree.sh | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/contrib/subtree/t/t7900-subtree.sh
b/contrib/subtree/t/t7900-subtree.sh
index bc2eeb0..5ae4584 100755
--- a/contrib/subtree/t/t7900-subtree.sh
+++ b/contrib/subtree/t/t7900-subtree.sh
@@ -505,4 +505,38 @@ test_expect_success 'verify one file change per commit' '
         ))
 '

+# return to mainline
+cd ../..
+
+# .gitsubtree
+# 55
+test_expect_success 'added repository appears in .gitsubtree' '
+        git subtree add --prefix=copy0 sub1 &&
+        grep "^copy0 \. sub1$" .gitsubtree
+'
+
+# 56
+test_expect_success 'change in subtree is pushed okay' '
+        cd copy0 && create new_file && git commit -m"Added new_file" &&
+        cd .. && git subtree push --prefix=copy0 2>&1 | \
+                grep -E "^   [0-9a-f]{7}\.\.[0-9a-f]{7}  [0-9a-f]{40} -> sub1$"
+'
+
+# 57
+test_expect_success 'pull into subtree okay' '
+        git subtree add --prefix=copy1 sub1 &&
+        git subtree add --prefix=copy2 sub1 &&
+        cd copy1 && create new_file_in_copy1 && git commit -m"Added
new_file_in_copy1" &&
+        cd .. && git subtree push --prefix=copy1 &&
+        git subtree pull --prefix=copy2 | grep "^ create mode 100644
copy2/new_file_in_copy1$"
+'
+
+# 58
+test_expect_success 'replace outdated entry in .gitsubtree' '
+        echo "copy3 . sub2" >> .gitsubtree &&
+        git subtree add --prefix=copy3 sub1 &&
+        (grep "^copy3 . sub2$" .gitsubtree && die || true) &&
+        grep "^copy3 . sub1$" .gitsubtree
+'
+
 test_done
-- 
1.8.1.3.566.gaa39828

^ permalink raw reply related

* [PATCH 2/4] contrib/subtree: Allow stale .gitsubtree entries to be replaced
From: Paul Campbell @ 2013-02-12 23:23 UTC (permalink / raw)
  To: git; +Cc: David A. Greene, Michael Schubert

Should .gitsubtree have a <prefix> listed that doesn't exist on disk, allow
it to be replaced/updated by a git subtree add.

Ideally I would have aborted the operation if there was an existing entry
and required the user to edit the .gitsubtree file by hand, but that
behaviour broke a lot of the tests.

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 02aae30..4f21902 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -490,7 +490,13 @@ ensure_clean()

 subtree_memorize()
 {
-	if [ $# -eq 1 ] ; then
+	if ( grep "^$dir " .gitsubtree ); then
+		# remove $dir from .gitsubtree - there's probably a clever way to
do this with sed
+		grep -v "^$dir " .gitsubtree > .gitsubtree.temp
+		rm .gitsubtree
+		mv .gitsubtree.temp .gitsubtree
+	fi
+	if [ $# -eq 1 ]; then
 		echo "$dir . $@" >> .gitsubtree
 	elif [ $# -eq 2 ]; then
 		echo "$dir $@" >> .gitsubtree
-- 
1.8.1.3.566.gaa39828

^ permalink raw reply related

* [PATCH 1/4] contrib/subtree: Store subtree sources in .gitsubtree and use for push/pull
From: Paul Campbell @ 2013-02-12 23:21 UTC (permalink / raw)
  To: git; +Cc: David A. Greene, Michael Schubert

Having to remember what subtree came from what source is a waste of
developer memory and doesn't transfer easily to other developers.

git subtree push/pull operations would typically be to/from the same
source that the original subtree was cloned from with git subtree add.


The <repository> and <refspec>, or <commit>, used in the git subtree add
operation are stored in .gitsubtree. One line each delimited by a space:
<prefix> <repository> <refspec> or <prefix> . <commit>.

Subsequent git subtree push/pull operations now default to the values
stored in .gitsubtree, unless overridden from the command line.

The .gitsubtree file should be tracked as part of the repo as it
describes where parts of the tree came from and can be used to update
to/from that source.

Signed-off-by: Paul Campbell <pcampbell@kemitix.net>
---
 contrib/subtree/git-subtree.sh | 42 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 5 deletions(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 920c664..02aae30 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -488,6 +488,23 @@ ensure_clean()
  fi
 }

+subtree_memorize()
+{
+ if [ $# -eq 1 ] ; then
+ echo "$dir . $@" >> .gitsubtree
+ elif [ $# -eq 2 ]; then
+ echo "$dir $@" >> .gitsubtree
+ else
+ # don't know how to handle this
+ echo "Not memorizing subtree: $dir $@"
+ fi
+}
+
+subtree_remember()
+{
+ grep "^$dir " .gitsubtree || die "Subtree $dir isn't in .gitsubtree"
+}
+
 cmd_add()
 {
  if [ -e "$dir" ]; then
@@ -496,6 +513,7 @@ cmd_add()

  ensure_clean

+ subtree_memorize "$@"
  if [ $# -eq 1 ]; then
  "cmd_add_commit" "$@"
  elif [ $# -eq 2 ]; then
@@ -688,7 +706,17 @@ cmd_merge()
 cmd_pull()
 {
  ensure_clean
- git fetch "$@" || exit $?
+ if [ $# -eq 0 ]; then
+ memory=($(subtree_remember))
+ echo "Pulling into '$dir' from '${memory[1]}' '${memory[2]}'"
+ repository=${memory[1]}
+ refspec=${memory[2]}
+ echo "git fetch using: " $repository $refspec
+ git fetch "$repository" "$refspec" || exit $?
+ else
+ echo "git fetch using: $@"
+ git fetch "$@" || exit $?
+ fi
  revs=FETCH_HEAD
  set -- $revs
  cmd_merge "$@"
@@ -696,12 +724,16 @@ cmd_pull()

 cmd_push()
 {
- if [ $# -ne 2 ]; then
-    die "You must provide <repository> <refspec>"
+ repository=$1
+ refspec=$2
+ if [ $# -eq 0 ]; then
+ memo=($(subtree_remember))
+ repository=${memo[1]}
+ refspec=${memo[2]}
+ elif [ $# -ne 2 ]; then
+ die "You must provide <repository> <refspec> or a <prefix> listed in
.gitsubtree"
  fi
  if [ -e "$dir" ]; then
-    repository=$1
-    refspec=$2
     echo "git push using: " $repository $refspec
     git push $repository $(git subtree split
--prefix=$prefix):refs/heads/$refspec
  else
--
1.8.1.3.566.gaa39828


--
Paul [W] Campbell

^ permalink raw reply related

* Re: [PATCH] Makefile: do not export mandir/htmldir/infodir
From: John Keeping @ 2013-02-12 23:20 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Junio C Hamano, git, Steffen Prohaska, Jakub Narebski
In-Reply-To: <20130212231651.GI12240@google.com>

On Tue, Feb 12, 2013 at 03:16:51PM -0800, Jonathan Nieder wrote:
> Junio C Hamano wrote:
> 
> > These are defined in the main Makefile to be funny values that are
> > optionally relative to an unspecified location that is determined at
> > runtime.
> [...]
> > A longer term fix is to introduce runtime_{man,html,info}dir variables
> > to hold these funny values, and make {man,html,info}dir variables
> > to have real paths whose default values begin with $(prefix), but
> > as a first step, stop exporting them from the top-level Makefile.
> 
> Makes sense.
> 
> Reported-by: John Keeping <john@keeping.me.uk>
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Fixes my original problem, so FWIW:

Tested-by: John Keeping <john@keeping.me.uk>

^ permalink raw reply

* Re: [PATCH] Makefile: do not export mandir/htmldir/infodir
From: Jonathan Nieder @ 2013-02-12 23:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: John Keeping, git, Steffen Prohaska, Jakub Narebski
In-Reply-To: <7vehgldt8e.fsf_-_@alter.siamese.dyndns.org>

Junio C Hamano wrote:

> These are defined in the main Makefile to be funny values that are
> optionally relative to an unspecified location that is determined at
> runtime.
[...]
> A longer term fix is to introduce runtime_{man,html,info}dir variables
> to hold these funny values, and make {man,html,info}dir variables
> to have real paths whose default values begin with $(prefix), but
> as a first step, stop exporting them from the top-level Makefile.

Makes sense.

Reported-by: John Keeping <john@keeping.me.uk>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

^ permalink raw reply

* Re: [PATCH 0/3] Fix installation paths with "make install-doc"
From: Junio C Hamano @ 2013-02-12 23:16 UTC (permalink / raw)
  To: John Keeping; +Cc: Jonathan Nieder, git, Steffen Prohaska, Jakub Narebski
In-Reply-To: <20130212230600.GB22779@river>

John Keeping <john@keeping.me.uk> writes:

> Looks like it - I tried this for the first time today (with pu) so I
> didn't realise it was a recent change, and I didn't think to blame the
> export line.

Unfortunately that bogus change is already in 'next', but luckily we
caught it before it graduated to 'master' ;-)

I'll queue the regression fix patch (already sent separately); the
patch should bring everything in Makefile back to the same state as
in 'master', so in that sense it fixes the regression, but it does
not address the real cause of the confusion, solution to which is
hinted in the log message of the patch.

Thanks for catching this.

^ permalink raw reply

* Re: A good Git technique for referring back to original files
From: Paul Campbell @ 2013-02-12 23:13 UTC (permalink / raw)
  To: MikeW; +Cc: git
In-Reply-To: <loom.20130212T110458-119@post.gmane.org>

Hi Mike,

I think git-cvsimport and git-subtree could help you here.

Roughly:

# Create a git version of each SDK_subproj
git cvsimport -r upstream -d $CVSREPO1 $CVSMODULE1 -C SDK_subproj1
git cvsimport -r upstream -d $CVSREPO2 $CVSMODULE2 -C SDK_subproj2

# Create your Working_SDK
git init Working_SDK
cd Working_SDK

# Import the SDK_subprojN repos
git subtree add --prefix=subproj1 ../SDK_subproj1 upstream/master
git subtree add --prefix=subproj2 ../SDK_subproj2 upstream/master

# Edit and commit your files
# N.B. when committing don't commit to more than one subproj in a single commit

# Update from the upstream CVS as needed
git cvsimport -r upstream -d $CVSREPO1 $CVSMODULE1 -C ../SDK_subproj1
git subtree pull --prefix=subproj1 ../SDK_subproj1 upstream/master
git cvsimport -r upstream -d $CVSREPO2 $CVSMODULE2 -C ../SDK_subproj2
git subtree pull --prefix=subproj2 ../SDK_subproj2 upstream/master

# Push your changes back to SDK_subproj repos into a branch other than master
git subtree push --prefix=subproj1 ../SDK_subproj1 new-branch
git subtree push --prefix=subproj1 ../SDK_subproj2 new-branch

# Prepare patches to apply to a real CVS copy or submit upstream
(cd ../SDK_subproj1 && git format-patch upstream/master..new-branch)
(cd ../SDK_subproj2 && git format-patch upstream/master..new-branch)

Hope that helps.

--
Paul

On Tue, Feb 12, 2013 at 10:19 AM, MikeW <mw_phil@yahoo.co.uk> wrote:
> Matthieu Moy <Matthieu.Moy <at> grenoble-inp.fr> writes:
>
>>
>> MikeW <mw_phil <at> yahoo.co.uk> writes:
>>
>> > Since git is so good at tracking file content, I wondered whether
> there was any
>> > technique using git that would simplify the back-referencing task.
>>
>> I'm not sure I understand the question, but if you want to add meta-data
>> to Git commits (e.g. "this Git commit is revision 42 in CVS repository
>> foo"), then have a look at git-notes. It won't give you directly
>> "reference to other VCS", but at least can be used as a storage
>> mechanism to store these references.
>>
> Thanks for the reply.
>
> In my work environment both the SDK and the original files are available
> (in an enclosing directory).
>
> --SDK_content
>   |
>   SDK_subproj1-- ...
>   |            |
>   |            content
>   |
>   SDK_subproj2- ...
>   |            |
>   |            content
>   |
>   SDK_subprojN- ...
>   |            |
>   |            content
>   |
>   Working_SDK ... (under git, baseline generated from subproj1..N)
>                |
>                content derived from subproj1..N
>
>
> What I had in mind was something I could run over, say, SDK_content
> (alternatively, from within Working_SDK, referring back to SDK_content)
> which would note the changed files in Working_SDK and locate the
> original files in SDK_subproj1..N letting me merge the changes back.
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
Paul [W] Campbell

^ permalink raw reply

* [PATCH] Makefile: do not export mandir/htmldir/infodir
From: Junio C Hamano @ 2013-02-12 23:09 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: John Keeping, git, Steffen Prohaska, Jakub Narebski
In-Reply-To: <7vip5xdtt6.fsf@alter.siamese.dyndns.org>

These are defined in the main Makefile to be funny values that are
optionally relative to an unspecified location that is determined at
runtime.  They are only suitable for hardcoding in the binary via
the -DGIT_{MAN,HTML,INFO}_PATH=<value> C preprocessor options, and
are not real paths, contrary to what any sane person, and more
importantly, the Makefile in the documentation directory, would
expect.

A longer term fix is to introduce runtime_{man,html,info}dir variables
to hold these funny values, and make {man,html,info}dir variables
to have real paths whose default values begin with $(prefix), but
as a first step, stop exporting them from the top-level Makefile.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 1dae2c5..26b697d 100644
--- a/Makefile
+++ b/Makefile
@@ -359,7 +359,7 @@ lib = lib
 # DESTDIR=
 pathsep = :
 
-export prefix bindir sharedir mandir htmldir sysconfdir gitwebdir localedir
+export prefix bindir sharedir sysconfdir gitwebdir localedir
 
 CC = cc
 AR = ar
-- 
1.8.1.3.675.g524d3b9

^ permalink raw reply related

* Re: [PATCH 0/3] Fix installation paths with "make install-doc"
From: John Keeping @ 2013-02-12 23:06 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jonathan Nieder, git, Steffen Prohaska, Jakub Narebski
In-Reply-To: <7vip5xdtt6.fsf@alter.siamese.dyndns.org>

On Tue, Feb 12, 2013 at 02:57:25PM -0800, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > I _think_ exporting mandir/html/infodir from the top-level Makefile
> > is wrong to begin with.  We should drop the "export mandir" from
> > there.
> 
> Ah, it is this thing, isn't it?
> 
> commit d8cf908cb6012cd4dc3d1089a849daf646150c2e
> Author: Junio C Hamano <gitster@pobox.com>
> Date:   Sat Feb 2 17:58:49 2013 -0800
> 
>     config.mak.in: remove unused definitions
>     
>     When 5566771 (autoconf: Use autoconf to write installation
>     directories to config.mak.autogen, 2006-07-03) introduced support
>     for autoconf generated config.mak file, it added an "export" for a
>     few common makefile variables, in addition to definitions of srcdir
>     and VPATH.
>     
>     The "export" logically does not belong there.  The make variables
>     like mandir, prefix, etc, should be exported to submakes for people
>     who use config.mak and people who use config.mak.autogen the same
>     way; if we want to get these exported, that should be in the main
>     Makefile.
>     
>     We do use mandir and htmldir in Documentation/Makefile, so let's
>     add export for them in the main Makefile instead.
>     
>     We may eventually want to support VPATH, and srcdir may turn out to
>     be useful for that purpose, but right now nobody uses it, so it is
>     useless to define them in this file.
>     
>     Signed-off-by: Junio C Hamano <gitster@pobox.com>

Looks like it - I tried this for the first time today (with pu) so I
didn't realise it was a recent change, and I didn't think to blame the
export line.


John

^ permalink raw reply

* Re: [PATCH 0/3] Fix installation paths with "make install-doc"
From: John Keeping @ 2013-02-12 23:00 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jonathan Nieder, git, Steffen Prohaska, Jakub Narebski
In-Reply-To: <7vmwv9ducx.fsf@alter.siamese.dyndns.org>

On Tue, Feb 12, 2013 at 02:45:34PM -0800, Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
> 
> > John Keeping wrote:
> >
> >>   Documentation/Makefile: fix inherited {html,info,man}dir
> >
> > This doesn't seem to have hit the list.
> 
> More importantly, 
> 
> >> When using the top-level install-doc target the html, info and man
> >> target directories are inherited from the top-level Makefile by the
> >> documentation Makefile as relative paths, which is not expected and
> >> results in the files being installed in an unexpected location.
> 
> I am not sure what problem it is trying to address.  During every
> cycle "make doc && make install-man install-html" is run for all
> integration branches and it didn't cause any problems.
> 
> A wild guess.  John, are you using config.mak.autogen?

Close - plain config.mak.

I set $prefix there and ran "make install-doc".  That installed the man
pages in Documentation/share/man/ in my Git source directory.

> I _think_ exporting mandir/html/infodir from the top-level Makefile
> is wrong to begin with.  We should drop the "export mandir" from
> there.
> 
> Giving them unusual meaning (e.g. "mandir = share/man") is already
> bad and that needs to be fixed by limiting this "oh, on some
> platforms we compile-in GIT_MAN_PATH as a relative path to an
> unspecified place" insanity only to where -DGIT_MAN_PATH=<path> is
> defined.  The path used there does not help the building and
> installation of the documentation at all, so the variable used for
> the purpose of giving that <path> should not be named the same way
> as the variable used on Documentation/Makefile to name the real path
> in the first place.
> 
> Perhaps rename these to runtime_{man,html,info}dir or something and
> make sure {man,html,info}dir are defined as the real paths whose
> default values begin with $(prefix)?

Would it be sensible to define the values for these variables (with
absolute paths) in a separate top-level file like config.mak.uname
(defaults.mak maybe?) and include that in both Documentation/Makefile
and Makefile, then calculate the relative path from $(prefix) to
$({man,html,info}dir) for the compiled-in values.


John

^ permalink raw reply

* Re: [PATCH 0/3] Fix installation paths with "make install-doc"
From: Junio C Hamano @ 2013-02-12 22:57 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: John Keeping, git, Steffen Prohaska, Jakub Narebski
In-Reply-To: <7vmwv9ducx.fsf@alter.siamese.dyndns.org>

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

> I _think_ exporting mandir/html/infodir from the top-level Makefile
> is wrong to begin with.  We should drop the "export mandir" from
> there.

Ah, it is this thing, isn't it?

commit d8cf908cb6012cd4dc3d1089a849daf646150c2e
Author: Junio C Hamano <gitster@pobox.com>
Date:   Sat Feb 2 17:58:49 2013 -0800

    config.mak.in: remove unused definitions
    
    When 5566771 (autoconf: Use autoconf to write installation
    directories to config.mak.autogen, 2006-07-03) introduced support
    for autoconf generated config.mak file, it added an "export" for a
    few common makefile variables, in addition to definitions of srcdir
    and VPATH.
    
    The "export" logically does not belong there.  The make variables
    like mandir, prefix, etc, should be exported to submakes for people
    who use config.mak and people who use config.mak.autogen the same
    way; if we want to get these exported, that should be in the main
    Makefile.
    
    We do use mandir and htmldir in Documentation/Makefile, so let's
    add export for them in the main Makefile instead.
    
    We may eventually want to support VPATH, and srcdir may turn out to
    be useful for that purpose, but right now nobody uses it, so it is
    useless to define them in this file.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.mak.in shouldn't have exported mandir in the first place, and
the commit made it worse by moving that broken export to the main
Makefile, and also added an export to htmldir as well, which was
totally wrong.

Let me revert that bit first.

I still think making "mandir" to have the real path in both the
top-level Makefile and Documentation/Makefile and renaming the
variable that is used to form the -DGIT_MAN_PATH=<path> to
optionally compile in a path relative to an unspecified location
that is discovered at runtime to something else is the sane thing to
do, but that is a separate issue, I think.

^ permalink raw reply

* Re: [PATCH v4 11/12] format-patch: update append_signoff prototype
From: Brandon Casey @ 2013-02-12 22:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, pclouds, jrnieder, Brandon Casey
In-Reply-To: <7v1uclgwk7.fsf@alter.siamese.dyndns.org>

On Tue, Feb 12, 2013 at 11:29 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Brandon Casey <drafnel@gmail.com> writes:

>> diff --git a/builtin/log.c b/builtin/log.c
>> index 8f0b2e8..59de484 100644
>> --- a/builtin/log.c
>> +++ b/builtin/log.c

>> @@ -253,9 +255,12 @@ static int detect_any_signoff(char *letter, int size)
>>       return seen_head && seen_name;
>>  }
>>
>> -static void append_signoff(struct strbuf *sb, const char *signoff)
>> +static void append_signoff(struct strbuf *sb, int ignore_footer, unsigned flag)
>>  {
>> +     unsigned no_dup_sob = flag & APPEND_SIGNOFF_DEDUP;
>
> Unused variable at this step?

Yeah, looks like that line can be dropped.

-Brandon

^ permalink raw reply

* Re: [PATCHv4 4/6] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe
From: Michal Nazarewicz @ 2013-02-12 22:50 UTC (permalink / raw)
  To: Junio C Hamano, Jeff King; +Cc: git
In-Reply-To: <7va9r9fd4e.fsf@alter.siamese.dyndns.org>

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

On Tue, Feb 12 2013, Junio C Hamano wrote:
> I would actually vote for the most explicit:
>
> 	_cmd_close($ctx, (grep { defined } ($in, $out)));

To me that looks weird at best, but I don't have strong opinions on that
matter.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply

* Re: [PATCH 0/3] Fix installation paths with "make install-doc"
From: Junio C Hamano @ 2013-02-12 22:45 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: John Keeping, git, Steffen Prohaska, Jakub Narebski
In-Reply-To: <20130212222508.GG12240@google.com>

Jonathan Nieder <jrnieder@gmail.com> writes:

> John Keeping wrote:
>
>>   Documentation/Makefile: fix inherited {html,info,man}dir
>
> This doesn't seem to have hit the list.

More importantly, 

>> When using the top-level install-doc target the html, info and man
>> target directories are inherited from the top-level Makefile by the
>> documentation Makefile as relative paths, which is not expected and
>> results in the files being installed in an unexpected location.

I am not sure what problem it is trying to address.  During every
cycle "make doc && make install-man install-html" is run for all
integration branches and it didn't cause any problems.

A wild guess.  John, are you using config.mak.autogen?

I _think_ exporting mandir/html/infodir from the top-level Makefile
is wrong to begin with.  We should drop the "export mandir" from
there.

Giving them unusual meaning (e.g. "mandir = share/man") is already
bad and that needs to be fixed by limiting this "oh, on some
platforms we compile-in GIT_MAN_PATH as a relative path to an
unspecified place" insanity only to where -DGIT_MAN_PATH=<path> is
defined.  The path used there does not help the building and
installation of the documentation at all, so the variable used for
the purpose of giving that <path> should not be named the same way
as the variable used on Documentation/Makefile to name the real path
in the first place.

Perhaps rename these to runtime_{man,html,info}dir or something and
make sure {man,html,info}dir are defined as the real paths whose
default values begin with $(prefix)?

^ permalink raw reply

* Re: [PATCH 0/3] Fix installation paths with "make install-doc"
From: Jonathan Nieder @ 2013-02-12 22:39 UTC (permalink / raw)
  To: John Keeping; +Cc: git, Steffen Prohaska, Jakub Narebski
In-Reply-To: <20130212223657.GJ2270@serenity.lan>

John Keeping wrote:
> On Tue, Feb 12, 2013 at 02:25:08PM -0800, Jonathan Nieder wrote:
>> John Keeping wrote:

>>>   Documentation/Makefile: fix inherited {html,info,man}dir
>>
>> This doesn't seem to have hit the list.
>
> Hmm... it made it to gmane:
>
> http://article.gmane.org/gmane.comp.version-control.git/216188

So it did.  Sorry for the noise --- I'll grab it from there.

Sincerely,
Jonathan

^ permalink raw reply

* Re: [PATCH 0/3] Fix installation paths with "make install-doc"
From: John Keeping @ 2013-02-12 22:36 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Steffen Prohaska, Jakub Narebski
In-Reply-To: <20130212222508.GG12240@google.com>

On Tue, Feb 12, 2013 at 02:25:08PM -0800, Jonathan Nieder wrote:
> John Keeping wrote:
> 
> >   Documentation/Makefile: fix inherited {html,info,man}dir
> 
> This doesn't seem to have hit the list.

Hmm... it made it to gmane:

http://article.gmane.org/gmane.comp.version-control.git/216188

^ permalink raw reply

* Re: [PATCH 2/2] t9903: add test case for bash.showUntrackedFiles
From: Junio C Hamano @ 2013-02-12 22:29 UTC (permalink / raw)
  To: Martin Erik Werner; +Cc: git, trsten
In-Reply-To: <1360699936-28688-3-git-send-email-martinerikwerner@gmail.com>

Martin Erik Werner <martinerikwerner@gmail.com> writes:

> Add a test case for the bash.showUntrackedFiles config option, which
> checks that the config option can disable the global effect of the
> GIT_PS1_SHOWUNTRACKEDFILES environmant variable.
>
> Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
> ---
>  t/t9903-bash-prompt.sh |   11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
> index f17c1f8..c9417b9 100755
> --- a/t/t9903-bash-prompt.sh
> +++ b/t/t9903-bash-prompt.sh
> @@ -447,6 +447,17 @@ test_expect_success 'prompt - untracked files status indicator - not shown insid
>  	test_cmp expected "$actual"
>  '
>  
> +test_expect_success 'prompt - untracked files status indicator - disabled by config' '
> +	printf " (master)" > expected &&
> +	echo "untracked" > file_untracked &&
> +	test_config bash.showUntrackedFiles false &&
> +	(
> +		GIT_PS1_SHOWUNTRACKEDFILES=y &&
> +		__git_ps1 > "$actual"
> +	) &&
> +	test_cmp expected "$actual"
> +'

All six combinations need checking:

 * not having the configuration at all and not having the shell
   variable should not show the untracked indicator (already tested).

 * not having the configuration at all and having the shell variable
   should show the untracked indicator (already tested).

 * setting configuration to true without having the shell variable
   should not show the untracked indicator.

 * setting configuration to true and having the shell variable
   should show the unttracked indicator.

 * setting configuration to false and having the shell variable
   should not show the untracked indicator (the above test checks
   this).

 * setting configuration to false without having the shell variable
   should not show the untracked indicator.

to prevent others from breaking the code you wrote for [PATCH 1/2],
so you need three more tests, I guess?

^ permalink raw reply

* Re: [PATCH 0/3] Fix installation paths with "make install-doc"
From: Jonathan Nieder @ 2013-02-12 22:25 UTC (permalink / raw)
  To: John Keeping; +Cc: git, Steffen Prohaska, Jakub Narebski
In-Reply-To: <cover.1360700102.git.john@keeping.me.uk>

John Keeping wrote:

>   Documentation/Makefile: fix inherited {html,info,man}dir

This doesn't seem to have hit the list.

Thanks,
Jonathan

^ permalink raw reply

* Re: [PATCH 1/2] bash completion: add bash.showUntrackedFiles option
From: Junio C Hamano @ 2013-02-12 22:17 UTC (permalink / raw)
  To: Martin Erik Werner; +Cc: git, trsten
In-Reply-To: <1360699936-28688-2-git-send-email-martinerikwerner@gmail.com>

Martin Erik Werner <martinerikwerner@gmail.com> writes:

> Add a config option 'bash.showUntrackedFiles' which allows enabling
> the prompt showing untracked files on a per-repository basis. This is
> useful for some repositories where the 'git ls-files ...' command may
> take a long time.
>
> Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
> ---

OK.

The subject needs to be corrected, though ;-) No need to resend.
I'll do s/completion/prompt/ while applying.

Thanks.

>  contrib/completion/git-prompt.sh |   11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
> index 9bef053..9b2eec2 100644
> --- a/contrib/completion/git-prompt.sh
> +++ b/contrib/completion/git-prompt.sh
> @@ -43,7 +43,10 @@
>  #
>  # If you would like to see if there're untracked files, then you can set
>  # GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're untracked
> -# files, then a '%' will be shown next to the branch name.
> +# files, then a '%' will be shown next to the branch name.  You can
> +# configure this per-repository with the bash.showUntrackedFiles
> +# variable, which defaults to true once GIT_PS1_SHOWUNTRACKEDFILES is
> +# enabled.
>  #
>  # If you would like to see the difference between HEAD and its upstream,
>  # set GIT_PS1_SHOWUPSTREAM="auto".  A "<" indicates you are behind, ">"
> @@ -332,8 +335,10 @@ __git_ps1 ()
>  			fi
>  
>  			if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ]; then
> -				if [ -n "$(git ls-files --others --exclude-standard)" ]; then
> -					u="%"
> +				if [ "$(git config --bool bash.showUntrackedFiles)" != "false" ]; then
> +					if [ -n "$(git ls-files --others --exclude-standard)" ]; then
> +						u="%"
> +					fi
>  				fi
>  			fi

^ permalink raw reply

* Re: [PATCH] completion: support 'git config --local'
From: Junio C Hamano @ 2013-02-12 22:13 UTC (permalink / raw)
  To: Jeff King; +Cc: Matthieu Moy, git, Dasa Paddock
In-Reply-To: <20130212211140.GA29358@sigill.intra.peff.net>

Jeff King <peff@peff.net> writes:

> I'm not sure I understand the original poster's point about "git config
> -l --local". "-l" does not take a limiter, does it?

"git config -l core.\*" will just die without limiting the output to
everything under core. hierarchy, so you are right---the combination
does not make any sense.  You have to say

    git config -l | grep ^core\\.

or something like that.

Completing "git config -l --lo<TAB>" still may help, though.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox