Git development
 help / color / mirror / Atom feed
* Re: [PATCH v2] Add --track option to git clone
From: Junio C Hamano @ 2009-12-02 23:02 UTC (permalink / raw)
  To: Jeff King; +Cc: Nanako Shiraishi, David Soria Parra, git
In-Reply-To: <20091202223728.GB9691@coredump.intra.peff.net>

Jeff King <peff@peff.net> writes:

>>   git clone -f maint,master,next,pu git.git
>
> Yeah, that is much nicer. I think "," is allowed in ref names, but I
> am tempted not to care here. It is not as if this is a low-level
> feature, and most people will not be crazy enough to use commas in their
> branch-names. IOW, you will get into trouble only if you have crazy
> names _and_ you want to use this particular feature. If we wanted to be
> complete, we could provide a quoting mechanism, but that is perhaps
> excessive.

Yeah, I agree it is Ok not to support crazy people in this case.  Not
supporting from the very beginning is quite different from _breaking_ them
;-)

^ permalink raw reply

* Re: [PATCH] pull: clarify advice for the unconfigured error case
From: Junio C Hamano @ 2009-12-02 23:08 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Jan Krüger, Jeff King, Jan Nieuwenhuizen, Tomas Carnecky,
	git list
In-Reply-To: <20091127141704.GA24080@progeny.tock>

Jonathan Nieder <jrnieder@gmail.com> writes:

> From: Jan Krüger <jk@jk.gs>
>
> When pull --rebase fails because it cannot find what branch to
> merge against, the error message implies we are trying to merge.
> Say "rebase against" instead of "merge with" to avoid confusion.

I was going over the mail archive to see if I missed any important fixes
that should be in before 1.6.6 final and noticed that this is not applied,
and there was no follow-up to this message either.

Is this a good replacement for 31971b3 (git-pull.sh --rebase: overhaul
error handling when no candidates are found, 2009-11-12) that is on 'pu'
and does the lack of follow-up mean everybody involved in the discussion
is happy with this version?

> diff --git a/git-pull.sh b/git-pull.sh
> index 37f3d93..2c384c4 100755
> --- a/git-pull.sh
> +++ b/git-pull.sh
> @@ -91,45 +91,63 @@ error_on_no_merge_candidates () {
>  		esac
>  	done
>  
> +	if test true = "$rebase"
> +	then
> +		op_type=rebase
> +		op_prep=against
> +	else
> +		op_type=merge
> +		op_prep=with
> +	fi
> +
>  	curr_branch=${curr_branch#refs/heads/}
>  	upstream=$(git config "branch.$curr_branch.merge")
>  	remote=$(git config "branch.$curr_branch.remote")
>  
>  	if [ $# -gt 1 ]; then
> -		echo "There are no candidates for merging in the refs that you just fetched."
> +		if [ "$rebase" = true ]; then
> +			printf "There is no candidate for rebasing against "
> +		else
> +			printf "There are no candidates for merging "
> +		fi
> +		echo "among the refs that you just fetched."
>  		echo "Generally this means that you provided a wildcard refspec which had no"
>  		echo "matches on the remote end."
>  	elif [ $# -gt 0 ] && [ "$1" != "$remote" ]; then
>  		echo "You asked to pull from the remote '$1', but did not specify"
> -		echo "a branch to merge. Because this is not the default configured remote"
> +		echo "a branch. Because this is not the default configured remote"
>  		echo "for your current branch, you must specify a branch on the command line."
>  	elif [ -z "$curr_branch" ]; then
>  		echo "You are not currently on a branch, so I cannot use any"
>  		echo "'branch.<branchname>.merge' in your configuration file."
> -		echo "Please specify which branch you want to merge on the command"
> +		echo "Please specify which remote branch you want to use on the command"
>  		echo "line and try again (e.g. 'git pull <repository> <refspec>')."
>  		echo "See git-pull(1) for details."
>  	elif [ -z "$upstream" ]; then
>  		echo "You asked me to pull without telling me which branch you"
> -		echo "want to merge with, and 'branch.${curr_branch}.merge' in"
> -		echo "your configuration file does not tell me either.	Please"
> -		echo "specify which branch you want to merge on the command line and"
> +		echo "want to $op_type $op_prep, and 'branch.${curr_branch}.merge' in"
> +		echo "your configuration file does not tell me, either. Please"
> +		echo "specify which branch you want to use on the command line and"
>  		echo "try again (e.g. 'git pull <repository> <refspec>')."
>  		echo "See git-pull(1) for details."
>  		echo
> -		echo "If you often merge with the same branch, you may want to"
> -		echo "configure the following variables in your configuration"
> -		echo "file:"
> +		echo "If you often $op_type $op_prep the same branch, you may want to"
> +		echo "use something like the following in your configuration file:"
> +		echo
> +		echo "    [branch \"${curr_branch}\"]"
> +		echo "    remote = <nickname>"
> +		echo "    merge = <remote-ref>"
> +		test rebase = "$op_type" &&
> +			echo "    rebase = true"
>  		echo
> -		echo "    branch.${curr_branch}.remote = <nickname>"
> -		echo "    branch.${curr_branch}.merge = <remote-ref>"
> -		echo "    remote.<nickname>.url = <url>"
> -		echo "    remote.<nickname>.fetch = <refspec>"
> +		echo "    [remote \"<nickname>\"]"
> +		echo "    url = <url>"
> +		echo "    fetch = <refspec>"
>  		echo
>  		echo "See git-config(1) for details."
>  	else
> -		echo "Your configuration specifies to merge the ref '${upstream#refs/heads/}' from the"
> -		echo "remote, but no such ref was fetched."
> +		echo "Your configuration specifies to $op_type $op_prep the ref '${upstream#refs/heads/}'"
> +		echo "from the remote, but no such ref was fetched."
>  	fi
>  	exit 1
>  }
> -- 
> 1.6.5.3

^ permalink raw reply

* [ANNOUNCE] GIT 1.6.6.rc1
From: Junio C Hamano @ 2009-12-02 23:24 UTC (permalink / raw)
  To: git

A release candidate GIT 1.6.6.rc1 is available at the usual places
for testing:

  http://www.kernel.org/pub/software/scm/git/

  git-1.6.6.rc1.tar.{gz,bz2}			(source tarball)
  git-htmldocs-1.6.6.rc1.tar.{gz,bz2}		(preformatted docs)
  git-manpages-1.6.6.rc1.tar.{gz,bz2}		(preformatted docs)

The RPM binary packages for a few architectures are found in:

  testing/git-*-1.6.6.rc1-1.fc11.$arch.rpm	(RPM)

Git v1.6.6 Release Notes (draft)
================================

Notes on behaviour change
-------------------------

 * In this release, "git fsck" defaults to "git fsck --full" and
   checks packfiles, and because of this it will take much longer to
   complete than before.  If you prefer a quicker check only on loose
   objects (the old default), you can say "git fsck --no-full".  This
   has been supported by 1.5.4 and newer versions of git, so it is
   safe to write it in your script even if you use slightly older git
   on some of your machines.

Preparing yourselves for compatibility issues in 1.7.0
------------------------------------------------------

In git 1.7.0, which is planned to be the release after 1.6.6, there will
be a handful of behaviour changes that will break backward compatibility.

These changes were discussed long time ago and existing behaviours have
been identified as more problematic to the userbase than keeping them for
the sake of backward compatibility.

When necessary, transition strategy for existing users has been designed
not to force them running around setting configuration variables and
updating their scripts in order to either keep the traditional behaviour
or use the new behaviour on the day their sysadmin decides to install
the new version of git.  When we switched from "git-foo" to "git foo" in
1.6.0, even though the change had been advertised and the transition
guide had been provided for a very long time, the users procrastinated
during the entire transtion period, and ended up panicking on the day
their sysadmins updated their git installation.  We tried very hard to
avoid repeating that unpleasantness.

For changes decided to be in 1.7.0, we have been much louder to strongly
discourage such procrastination.  If you have been using recent versions
of git, you would have already seen warnings issued when you exercised
features whose behaviour will change, with the instruction on how to
keep the existing behaviour if you want to.  You hopefully should be
well prepared already.

Of course, we have also given "this and that will change in 1.7.0;
prepare yourselves" warnings in the release notes and announcement
messages.  Let's see how well users will fare this time.

 * "git push" into a branch that is currently checked out (i.e. pointed by
   HEAD in a repository that is not bare) will be refused by default.

   Similarly, "git push $there :$killed" to delete the branch $killed
   in a remote repository $there, when $killed branch is the current
   branch pointed at by its HEAD, will be refused by default.

   Setting the configuration variables receive.denyCurrentBranch and
   receive.denyDeleteCurrent to 'ignore' in the receiving repository
   can be used to override these safety features.  Versions of git
   since 1.6.2 have issued a loud warning when you tried to do them
   without setting the configuration, so repositories of people who
   still need to be able to perform such a push should already have
   been future proofed.

   Please refer to:

   http://git.or.cz/gitwiki/GitFaq#non-bare
   http://thread.gmane.org/gmane.comp.version-control.git/107758/focus=108007

   for more details on the reason why this change is needed and the
   transition process that already took place so far.

 * "git send-email" will not make deep threads by default when sending a
   patch series with more than two messages.  All messages will be sent
   as a reply to the first message, i.e. cover letter.  Git 1.6.6 (this
   release) will issue a warning about the upcoming default change, when
   it uses the traditional "deep threading" behaviour as the built-in
   default.  To squelch the warning but still use the "deep threading"
   behaviour, give --chain-reply-to option or set sendemail.chainreplyto
   to true.

   It has been possible to configure send-email to send "shallow thread"
   by setting sendemail.chainreplyto configuration variable to false.
   The only thing 1.7.0 release will do is to change the default when
   you haven't configured that variable.

 * "git status" will not be "git commit --dry-run".  This change does not
   affect you if you run the command without pathspec.

   Nobody sane found the current behaviour of "git status Makefile" useful
   nor meaningful, and it confused users.  "git commit --dry-run" has been
   provided as a way to get the current behaviour of this command since
   1.6.5.

 * "git diff" traditionally treated various "ignore whitespace" options
   only as a way to filter the patch output.  "git diff --exit-code -b"
   exited with non-zero status even if all changes were about changing the
   ammount of whitespace and nothing else.  and "git diff -b" showed the
   "diff --git" header line for such a change without patch text.

   In 1.7.0, the "ignore whitespaces" will affect the semantics of the
   diff operation itself.  A change that does not affect anything but
   whitespaces will be reported with zero exit status when run with
   --exit-code, and there will not be "diff --git" header for such a
   change.


Updates since v1.6.5
--------------------

(subsystems)

 * various git-gui updates including new translations, wm states, etc.

 * git-svn updates.

 * "git fetch" over http learned a new mode that is different from the
   traditional "dumb commit walker".

(portability)

 * imap-send can be built on mingw port.

(performance)

 * "git diff -B" has smaller memory footprint.

(usability, bells and whistles)

 * The object replace mechanism can be bypassed with --no-replace-objects
   global option given to the "git" program.

 * In configuration files, a few variables that name paths can begin with ~/
   and ~username/ and they are expanded as expected.

 * "git subcmd -h" now shows short usage help for many more subcommands.

 * "git bisect reset" can reset to an arbitrary commit.

 * "git checkout frotz" when there is no local branch "frotz" but there
   is only one remote tracking branch "frotz" is taken as a request to
   start the named branch at the corresponding remote tracking branch.

 * "git commit -c/-C/--amend" can be told with a new "--reset-author" option
   to ignore authorship information in the commit it is taking the message
   from.

 * "git describe" can be told to add "-dirty" suffix with "--dirty" option.

 * "git diff" learned --submodule option to show a list of one-line logs
   instead of differences between the commit object names.

 * "git diff" learned to honor diff.color.func configuration to paint
   function name hint printed on the hunk header "@@ -j,k +l,m @@" line
   in the specified color.

 * "git fetch" learned --all and --multiple options, to run fetch from
   many repositories, and --prune option to remove remote tracking
   branches that went stale.  These make "git remote update" and "git
   remote prune" less necessary (there is no plan to remove "remote
   update" nor "remote prune", though).

 * "git fsck" by default checks the packfiles (i.e. "--full" is the
   default); you can turn it off with "git fsck --no-full".

 * "git grep" can use -F (fixed strings) and -i (ignore case) together.

 * import-tars contributed fast-import frontend learned more types of
   compressed tarballs.

 * "git instaweb" knows how to talk with mod_cgid to apache2.

 * "git log --decorate" shows the location of HEAD as well.

 * "git log" and "git rev-list" learned to take revs and pathspecs from
   the standard input with the new "--stdin" option.

 * "--pretty=format" option to "log" family of commands learned:

   . to wrap text with the "%w()" specifier.
   . to show reflog information with "%g[sdD]" specifier.

 * "git notes" command to annotate existing commits.

 * "git merge" (and "git pull") learned --ff-only option to make it fail
   if the merge does not result in a fast-forward.

 * The ancient "git merge <message> HEAD <branch>..." syntax will be
   removed in later versions of git.  A warning is given and tells
   users to use the "git merge -m <message> <branch>..." instead.

 * "git mergetool" learned to use p4merge.

 * "git rebase -i" learned "reword" that acts like "edit" but immediately
   starts an editor to tweak the log message without returning control to
   the shell, which is done by "edit" to give an opportunity to tweak the
   contents.

 * "git send-email" can be told with "--envelope-sender=auto" to use the
   same address as "From:" address as the envelope sender address.

 * "git send-email" will issue a warning when it defaults to the
   --chain-reply-to behaviour without being told by the user and
   instructs to prepare for the change of the default in 1.7.0 release.

 * In "git submodule add <repository> <path>", <path> is now optional and
   inferred from <repository> the same way "git clone <repository>" does.

 * "git svn" learned to read SVN 1.5+ and SVK merge tickets.

 * "gitweb" can optionally render its "blame" output incrementally (this
   requires JavaScript on the client side).

 * Author names shown in gitweb output are links to search commits by the
   author.

Fixes since v1.6.5
------------------

All of the fixes in v1.6.5.X maintenance series are included in this
release, unless otherwise noted.

 * Enumeration of available merge strategies iterated over the list of
   commands in a wrong way, sometimes producing an incorrect result.
   Will backport by merging ed87465 (builtin-merge.c: call
   exclude_cmds() correctly., 2009-11-25).

 * "git format-patch revisions... -- path" issued an incorrect error
   message that suggested to use "--" on the command line when path
   does not exist in the current work tree (it is a separate matter if
   it makes sense to limit format-patch with pathspecs like that
   without using the --full-diff option).  Will backport by merging
   7e93d3b (format-patch: add test for parsing of "--", 2009-11-26).

 * "git shortlog" did not honor the "encoding" header embedded in the
   commit object like "git log" did.  Will backport by merging 79f7ca0
   (shortlog: respect commit encoding, 2009-11-25).

----------------------------------------------------------------

Changes since v1.6.6-rc0 are as follows:

Avery Pennarun (1):
      builtin-merge.c: call exclude_cmds() correctly.

Benjamin Kramer (1):
      Explicitly truncate bswap operand to uint32_t

Bert Wesarg (2):
      Give the hunk comment its own color
      get_ref_states: strdup entries and free util in stale list

Björn Gustavsson (11):
      Teach the --all option to 'git fetch'
      Teach the --multiple option to 'git fetch'
      Add the configuration option skipFetchAll
      Add missing test for 'git remote update --prune'
      Re-implement 'git remote update' using 'git fetch'
      Clarify and correct -z
      apply: apply works outside a repository
      apply: Format all options using back-quotes
      apply: Use the term "working tree" consistently
      Fix over-simplified documentation for 'git log -z'
      gitworkflows: Consistently back-quote git commands

Brian Gernhardt (1):
      t/gitweb-lib: Split HTTP response with non-GNU sed

Christian Couder (6):
      Documentation: add "Fighting regressions with git bisect" article
      replace: use a GIT_NO_REPLACE_OBJECTS env variable
      Documentation: fix typos and spelling in replace documentation
      Documentation: talk a little bit about GIT_NO_REPLACE_OBJECTS
      bisect: simplify calling visualizer using '--bisect' option
      Documentation: update descriptions of revision options related to '--bisect'

David Aguilar (1):
      help: Do not unnecessarily look for a repository

David Soria Parra (1):
      Documentation: Document --branch option in git clone synopsis

Erick Mattos (1):
      commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author

Felipe Contreras (3):
      format-patch: fix parsing of "--" on the command line
      format-patch: add test for parsing of "--"
      send-email: automatic envelope sender

Horst H. von Brand (1):
      git-pull.sh: Fix call to git-merge for new command format

Jakub Narebski (10):
      gitweb: Add optional "time to generate page" info in footer
      gitweb: Incremental blame (using JavaScript)
      gitweb: Colorize 'blame_incremental' view during processing
      gitweb: Create links leading to 'blame_incremental' using JavaScript
      gitweb: Minify gitweb.js if JSMIN is defined
      t/gitweb-lib.sh: Split gitweb output into headers and body
      gitweb: Document current snapshot rules via new tests
      gitweb.js: Harden setting blamed commit info in incremental blame
      gitweb: Make linking to actions requiring JavaScript a feature
      gitweb: Add link to other blame implementation in blame views

Jay Soffian (4):
      remote: refactor some logic into get_stale_heads()
      teach warn_dangling_symref to take a FILE argument
      builtin-fetch: add --prune option
      builtin-fetch: add --dry-run option

Jeff King (1):
      prune-packed: only show progress when stderr is a tty

Johannes Sixt (2):
      t4014-format-patch: do not assume 'test' is available as non-builtin
      Add a notice that only certain functions can print color escape codes

Jonathan Nieder (1):
      Makefile: do not clean arm directory

Junio C Hamano (19):
      mailinfo: -b option keeps [bracketed] strings that is not a [PATCH] marker
      Pretty-format: %[+-]x to tweak inter-item newlines
      read_revision_from_stdin(): use strbuf
      Teach --stdin option to "log" family
      setup_revisions(): do not call get_pathspec() too early
      Make --stdin option to "log" family read also pathspecs
      t9001: test --envelope-sender option of send-email
      Add trivial tests for --stdin option to log family
      Protect scripted Porcelains from GREP_OPTIONS insanity
      builtin-apply.c: pay attention to -p<n> when determining the name
      Remove dead code from "git am"
      emit_line(): don't emit an empty <SET><RESET> followed by a newline
      Update draft release notes to 1.6.6 before merging topics for -rc1
      git-merge: a deprecation notice of the ancient command line syntax
      Update draft release notes to 1.6.6 before -rc1
      Do not misidentify "git merge foo HEAD" as an old-style invocation
      merge: do not add standard message when message is given with -m option
      Prepare for 1.6.5.4
      Git 1.6.6-rc1

Mark Rada (2):
      gitweb: check given hash before trying to create snapshot
      gitweb: Smarter snapshot names

Martin Storsjö (3):
      Disable CURLOPT_NOBODY before enabling CURLOPT_PUT and CURLOPT_POST
      Refactor winsock initialization into a separate function
      Enable support for IPv6 on MinGW

Matthew Ogilvie (5):
      cvsserver doc: database generally can not be reproduced consistently
      config documentation: some configs are auto-set by git-init
      t2300: use documented technique to invoke git-sh-setup
      t3409 t4107 t7406 t9150: use dashless commands
      t/README: Document GIT_TEST_INSTALLED and GIT_TEST_EXEC_PATH

Matthieu Moy (4):
      merge-recursive: point the user to commit when file would be overwritten.
      user-manual: Document that "git merge" doesn't like uncommited changes.
      merge-recursive: make the error-message generation an extern function
      builtin-merge: show user-friendly error messages for fast-forward too.

Michael J Gruber (1):
      Documentation: Fix a few i.e./e.g. mix-ups

Nanako Shiraishi (2):
      t1200: fix a timing dependent error
      prepare send-email for smoother change of --chain-reply-to default

Nicolas Pitre (1):
      pack-objects: split implications of --all-progress from progress activation

Ramsay Allan Jones (1):
      git-count-objects: Fix a disk-space under-estimate on Cygwin

René Scharfe (2):
      strbuf_add_wrapped_text(): skip over colour codes
      mergetool--lib: simplify guess_merge_tool()

Stephen Boyd (3):
      gitweb.js: fix null object exception in initials calculation
      instaweb: restart server if already running
      gitweb.js: fix padLeftStr() and its usage

Tay Ray Chuan (1):
      remote-curl.c: fix rpc_out()

Uwe Kleine-König (1):
      shortlog: respect commit encoding

^ permalink raw reply

* [PATCH 2/2 v2] Document date formats accepted by parse_date()
From: Miklos Vajna @ 2009-12-02 23:49 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Nanako Shiraishi, Jeff King, git
In-Reply-To: <7v638p9ebz.fsf@alter.siamese.dyndns.org>

---

On Wed, Dec 02, 2009 at 02:54:40PM -0800, Junio C Hamano <gitster@pobox.com> wrote:
> I agree with the "native->internal" part of the suggestion.

Changed.

> Also "test-date parse" seems to accept things like these:
>
>     '2009.04.07 20:21:22 -0000'
>     '04/07/2009 20:21:22 -0000'
>     '07.04.2009 20:21:22 -0000'

Ah OK, I just tried 2009.04.07 (without the time part) and thought it
was about approxidate() as well. I added them.

 Documentation/date-formats.txt    |   26 ++++++++++++++++++++++++++
 Documentation/git-commit-tree.txt |    1 +
 Documentation/git-commit.txt      |    2 ++
 3 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/date-formats.txt

diff --git a/Documentation/date-formats.txt b/Documentation/date-formats.txt
new file mode 100644
index 0000000..c000f08
--- /dev/null
+++ b/Documentation/date-formats.txt
@@ -0,0 +1,26 @@
+DATE FORMATS
+------------
+
+The GIT_AUTHOR_DATE, GIT_COMMITTER_DATE environment variables
+ifdef::git-commit[]
+and the `--date` option
+endif::git-commit[]
+support the following date formats:
+
+Git internal format::
+	It is `<unix timestamp> <timezone offset>`, where `<unix
+	timestamp>` is the number of seconds since the UNIX epoch.
+	`<timezone offset>` is a positive or negative offset from UTC.
+	For example CET (which is 2 hours ahead UTC) is `+0200`.
+
+RFC 2822::
+	The standard email format as described by RFC 2822, for example
+	`Thu, 07 Apr 2005 22:13:13 +0200`.
+
+ISO 8601::
+	Time and date specified by the ISO 8601 standard, for example
+	`2005-04-07T22:13:13`. The parser accepts a space instead of the
+	`T` character as well.
++
+NOTE: In addition, the date part is accepted in the following formats:
+`YYYY.MM.DD`, `MM/DD/YYYY` and `DD.MM.YYYY`.
diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt
index b8834ba..4fec5d5 100644
--- a/Documentation/git-commit-tree.txt
+++ b/Documentation/git-commit-tree.txt
@@ -73,6 +73,7 @@ A commit comment is read from stdin. If a changelog
 entry is not provided via "<" redirection, 'git-commit-tree' will just wait
 for one to be entered and terminated with ^D.
 
+include::date-formats.txt[]
 
 Diagnostics
 -----------
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index cbbbeeb..17783b4 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -220,6 +220,8 @@ specified.
 	these files are also staged for the next commit on top
 	of what have been staged before.
 
+:git-commit: 1
+include::date-formats.txt[]
 
 EXAMPLES
 --------
-- 
1.6.5.2

^ permalink raw reply related

* Re: [PATCH] pull: clarify advice for the unconfigured error case
From: Jonathan Nieder @ 2009-12-03  1:26 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Jan Krüger, Jeff King, Jan Nieuwenhuizen, Tomas Carnecky,
	git list
In-Reply-To: <7vk4x57z4e.fsf@alter.siamese.dyndns.org>

Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>
>> From: Jan Krüger <jk@jk.gs>
>>
>> When pull --rebase fails because it cannot find what branch to
>> merge against, the error message implies we are trying to merge.
>> Say "rebase against" instead of "merge with" to avoid confusion.
[...]
> Is this a good replacement for 31971b3 (git-pull.sh --rebase: overhaul
> error handling when no candidates are found, 2009-11-12) that is on 'pu'

Yes, that is the intent.

> and does the lack of follow-up mean everybody involved in the discussion
> is happy with this version?

I’m not sure.  I know I like it. :-)

I was the only one with nitpicks about the wording (sorry).  Re
whether to use configuration file syntax or a 'git config' command
line snippet, it seemed like there was some consensus once it was
clear that the user would have to modify the lines anyway to fill in
the right values.  But others can speak up if this seems wrong.

Hope that helps,
Jonathan

^ permalink raw reply

* Re: Git documentation consistency (was: "git merge" merges too much!)
From: Greg A. Woods @ 2009-12-03  1:21 UTC (permalink / raw)
  To: The Git Mailing List
In-Reply-To: <20091202200904.GA7631@coredump.intra.peff.net>

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

At Wed, 2 Dec 2009 15:09:04 -0500, Jeff King <peff@peff.net> wrote:
Subject: Re: "git merge" merges too much!
> 
> I find git is much simpler to use and understand if you start "at the
> bottom" with the basic concepts (because for the most part, git is
> really a set of tools for manipulating the few basic data structures).

I think that's the problem actually -- I don't really want to know too
much about how it works under the hood (yet), I just want to use it in
the most effective way for my purposes.

There's lots of talk about using Git as the basis for a true high-level
VCS and SCM system, yet it doesn't look to me that anyone has created
such a VCS or SCMS using Git.


> I skimmed it and didn't see any inconsistency. If you have something
> specific in mind, please point it out so we can fix it.

I think anyone who's been participating on this list for any significant
amount of time is far too close to the subject to be able to serve as a
candid independent technical editor who could really help clean things
up and make the documentation much more consistent.  Obviously such an
editor would also require the help of experts at all the details too. :-)

Unfortunately I'm not a very good technical editor, and I don't really
have time to devote to doing such editing of documentation either.


> > (git-log(1) is worse than ls(1) for having too many options, but worst
> > of all in the release I'm still using it doesn't respond sensibly nor
> > consistently with other commands when given the "-?" option.)
> 
> $ ls -?
> ls: invalid option -- '?'
> Try `ls --help' for more information.

Please keep in mind all the world is not GNU:

	$ ls -?
	ls: unknown option -- ?
	usage: ls [-AaBbCcdFfghikLlmnopqRrSsTtuWwx1] [file ...]

My point was that _most_ other Git sub-commands already do respond to
"-?" sensibly with real, helpful, information; usually a summary of the
command options and parameters.

I.e. this is yet another form of inconsistency in "documentation" in
Git.  :-)

The reference to "ls" was just as a comparison with it's somewhat
extensive variety of options.  In fact "git log" is way more complex
than "ls" because its parameters are not all just simple flags like
those for "ls" -- they often have their own parameters too.


> $ git log -h
> usage: git log [<options>] [<since>..<until>] [[--] <path>...]
>    or: git show [options] <object>...

Indeed, so why the heck can't it do something similar with '-?'.  That's
just sloppy programming, no?  Most other commands know '-?', and despite
the silliness with GNU Ls, use of '-?' to request summary usage
information is pretty much a de facto standard for unix commands.

Your point about mentioning "--help" in the summary usage information is
a good one though -- especially for a command with a very complex set of
command-line parameters.  However that alone isn't sufficient -- users
still need the summary as that alone helps trigger associations and may
be sufficient to allow a user to proceed quickly to get the command to
do what they want.


(the whole "fatal: not a git repository" error for "git foo -[h?]"
handling is also a rather silly one -- but I guess when something grows
quickly and from many inputs there's not always time to keep some of
these basic things clean and consistent)

-- 
						Greg A. Woods
						Planix, Inc.

<woods@planix.com>       +1 416 218 0099        http://www.planix.com/

[-- Attachment #2: Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply

* Re: Git documentation consistency
From: Junio C Hamano @ 2009-12-03  1:34 UTC (permalink / raw)
  To: Greg A. Woods; +Cc: The Git Mailing List
In-Reply-To: <m1NG0O6-000kmgC@most.weird.com>

"Greg A. Woods" <woods@planix.com> writes:

> 	$ ls -?
> 	ls: unknown option -- ?
> 	usage: ls [-AaBbCcdFfghikLlmnopqRrSsTtuWwx1] [file ...]
> ...
> Most other commands know '-?', and despite
> the silliness with GNU Ls, use of '-?' to request summary usage
> information is pretty much a de facto standard for unix commands.

I think you are showing ignorance here, as -? is *not* even close to
standard, nor even widely used practice at all.  I somehow doubt your ls
would respond to "ls -X" any differently from "ls -?", but is giving the
same canned response to any unknown option.

The "usage: ls [-AaBbC...] [file...]" indeed is much better than abstract
"usage: frotz <options> <args>" that does not list what <options> are, but
that is a totally different thing.  On that point, I think Peff already
made a good suggestion of giving the full help text in such a case.

^ permalink raw reply

* Re: [PATCH] pull: clarify advice for the unconfigured error case
From: Jeff King @ 2009-12-03  1:43 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Junio C Hamano, Jan Krüger, Jan Nieuwenhuizen,
	Tomas Carnecky, git list
In-Reply-To: <20091203012535.GA16259@progeny.tock>

On Wed, Dec 02, 2009 at 07:26:14PM -0600, Jonathan Nieder wrote:

> > and does the lack of follow-up mean everybody involved in the discussion
> > is happy with this version?
> 
> I’m not sure.  I know I like it. :-)
> 
> I was the only one with nitpicks about the wording (sorry).  Re
> whether to use configuration file syntax or a 'git config' command
> line snippet, it seemed like there was some consensus once it was
> clear that the user would have to modify the lines anyway to fill in
> the right values.  But others can speak up if this seems wrong.

Yeah, that was my main complaint, and I withdrew it after getting a
clue. :) I gave the patch another quick look, and I think it is fine.

-Peff

^ permalink raw reply

* [RFC PATCH] Documentation: set a base URL for relative links
From: Todd Zullinger @ 2009-12-03  1:50 UTC (permalink / raw)
  To: git

The man.base.url.for.relative.links setting is used when generating the
NOTES sections of various man pages.  If unset, the output looks like
this:

        1. Everyday Git
           [set $man.base.url.for.relative.links]/everyday.html

Reported-by: Michal Schmidt (Fedora bug #543481)
Signed-off-by: Todd Zullinger <tmz@pobox.com>
---

This was reported to the Fedora bugzilla.  I checked and it's been
broken in the Fedora builds for quite a while.  In origin/man, the
first time it appeared was 3ae5cb60 (Autogenerated manpages for
v1.6.5.1-75-g02d56), which looks to be around the time that kernel.org
switched from F9 to F11.

I don't know the doc toolchain well enough to know how best to fix
this without breaking anything.  It would be ideal if the base URL
used was substituted and controllable via make variables.  That would
allow packagers to make it point to the on-disk documentation and make
git's documentation even easier to use when disconnected.

Any help or suggestions to refine this and test it on various docbook
versions would be most welcome.

 Documentation/manpage-base.xsl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Documentation/manpage-base.xsl b/Documentation/manpage-base.xsl
index a264fa6..50ce029 100644
--- a/Documentation/manpage-base.xsl
+++ b/Documentation/manpage-base.xsl
@@ -7,6 +7,10 @@
 <xsl:param name="man.output.quietly" select="1"/>
 <xsl:param name="refentry.meta.get.quietly" select="1"/>
 
+<!-- set a base URL for relative links -->
+<xsl:param name="man.base.url.for.relative.links"
+	>http://www.kernel.org/pub/software/scm/git/docs/</xsl:param>
+
 <!-- convert asciidoc callouts to man page format;
      git.docbook.backslash and git.docbook.dot params
      must be supplied by another XSL file or other means -->
-- 
1.6.6.rc0

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Just because everything is different doesn't mean anything has
changed.
    -- Irene Peter

^ permalink raw reply related

* Re: Git documentation consistency (was: "git merge" merges too much!)
From: Jeff King @ 2009-12-03  2:07 UTC (permalink / raw)
  To: The Git Mailing List
In-Reply-To: <m1NG0O6-000kmgC@most.weird.com>

On Wed, Dec 02, 2009 at 08:21:39PM -0500, Greg A. Woods wrote:

> > I find git is much simpler to use and understand if you start "at the
> > bottom" with the basic concepts (because for the most part, git is
> > really a set of tools for manipulating the few basic data structures).
> 
> I think that's the problem actually -- I don't really want to know too
> much about how it works under the hood (yet), I just want to use it in
> the most effective way for my purposes.
>
> There's lots of talk about using Git as the basis for a true high-level
> VCS and SCM system, yet it doesn't look to me that anyone has created
> such a VCS or SCMS using Git.

Sure, I can understand that. And I invite you (or anyone) to work on
such a VCS, and I am sure I am not alone on the list in sincerely hoping
you succeed and offering to help support however core git developers
can. But we have seen people try this in the past, and it never quite
seems to work.

All of the cogito people ended up migrating to git. I was one of them.
In my case, the git tools offered better access to the fundamental
operations, which is what I found interesting and powerful about it. I
suspect some others migrated for the same reasons, though perhaps many
did simply because cogito did not keep up with core git in terms of
features.

There is also "eg" these days, which attempts to do what you're saying.
I don't know how big a userbase it has; I've never been personally
interested in it.

> I think anyone who's been participating on this list for any significant
> amount of time is far too close to the subject to be able to serve as a
> candid independent technical editor who could really help clean things
> up and make the documentation much more consistent.  Obviously such an
> editor would also require the help of experts at all the details too. :-)

Sure, I think an outsider doing a really nice job of overhauling the
documentation would be nice. There are some git books, some by insiders,
and some not. For the same reason that you mention, it would hard for me
to assess their quality with too much objectivity. :)

My question was more of a "leaving aside overhauling the documentation,
did you see something obvious that we can fix right now" kind of thing.

> > $ ls -?
> > ls: invalid option -- '?'
> > Try `ls --help' for more information.
> 
> Please keep in mind all the world is not GNU:
> 
> 	$ ls -?
> 	ls: unknown option -- ?
> 	usage: ls [-AaBbCcdFfghikLlmnopqRrSsTtuWwx1] [file ...]

Right, but my point is unchanged. Neither ls actually _recognizes_
"-?". They do the same for "--bogosity".

> My point was that _most_ other Git sub-commands already do respond to
> "-?" sensibly with real, helpful, information; usually a summary of the
> command options and parameters.

Yes, for the same reason that "ls" does: they don't recognize it. But if
you are asking for "git log" to produce the short usage message, then
that is part of my issue (1) from the last message: "log" doesn't use
the same parseopt library as (most of) the rest of git[1].

Yes, it's inconsistent. Those inconsistencies were introduced over time
(before we had parseopt), and we are slowly fixing them over time.
Patches welcome. :)

[1] There are other inconsistencies because of this, too. You can't say
"git log -pz", but must say "git log -p -z".

> > $ git log -h
> > usage: git log [<options>] [<since>..<until>] [[--] <path>...]
> >    or: git show [options] <object>...
> 
> Indeed, so why the heck can't it do something similar with '-?'.  That's
> just sloppy programming, no?  Most other commands know '-?', and despite
> the silliness with GNU Ls, use of '-?' to request summary usage
> information is pretty much a de facto standard for unix commands.

Nothing "knows" -?, but it is true that the parseopt-ified commands
behave differently (and IMHO, better). You can call it sloppy, I guess;
it is really an artifact of commands being written and changing over
time. As I said, we are slowly converging on consistency.

And no, I don't want to get into a big debate over whether it is better
to plan your software up front, or to let it evolve over time. I have
opinions that do not necessarily line up with how git came into being,
but the end product is useful enough that I like to use it and hack on
it. :)

> (the whole "fatal: not a git repository" error for "git foo -[h?]"
> handling is also a rather silly one -- but I guess when something grows
> quickly and from many inputs there's not always time to keep some of
> these basic things clean and consistent)

The problem here is that there are two chunks of code: the "git"
wrapper, and the "log" command. The wrapper knows a few things about
each command like "does it need to be in a git repository?", and checks
that before we even look at the command-line options. There is an
explicit "check for --help" hack. Fixing that startup procedure to be
more sane would be possible, but there are a lot of hidden demons
lurking in changing the order of the startup sequence. Again, patches
welcome. :)

-Peff

^ permalink raw reply

* Re: [RFC PATCH] Documentation: set a base URL for relative links
From: Junio C Hamano @ 2009-12-03  2:16 UTC (permalink / raw)
  To: Todd Zullinger; +Cc: git
In-Reply-To: <20091203015005.GH23717@inocybe.localdomain>

Todd Zullinger <tmz@pobox.com> writes:

> I don't know the doc toolchain well enough to know how best to fix
> this without breaking anything.  It would be ideal if the base URL
> used was substituted and controllable via make variables.  That would
> allow packagers to make it point to the on-disk documentation and make
> git's documentation even easier to use when disconnected.

Thanks. It indeed appears that update to FC11 at k.org brought a few
issues to the documentation area.

I think we can do something like this and let distro people to decide what
URL to use.

 Documentation/Makefile |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 3f59952..abb75eb 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -104,6 +104,10 @@ ifdef DOCBOOK_SUPPRESS_SP
 XMLTO_EXTRA += -m manpage-suppress-sp.xsl
 endif
 
+ifdef MAN_BASE_URL
+XMLTO_EXTRA += --stringparam man.base.url.for.relative.links=$(MAN_BASE_URL)
+endif
+
 # If your target system uses GNU groff, it may try to render
 # apostrophes as a "pretty" apostrophe using unicode.  This breaks
 # cut&paste, so you should set GNU_ROFF to force them to be ASCII

^ permalink raw reply related

* Re: [RFC/PATCHv9 01/11] fast-import: Proper notes tree manipulation
From: Johan Herland @ 2009-12-03  3:45 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git, gitster
In-Reply-To: <20091202203953.GE31648@spearce.org>

(Oops. I forgot to answer a couple of your questions...)

On Wednesday 02 December 2009, Shawn O. Pearce wrote:
> Johan Herland <johan@herland.net> wrote:
> > +static unsigned int do_change_note_fanout(
> > +		struct tree_entry *orig_root, struct tree_entry *root,
> > +		char *hex_sha1, unsigned int hex_sha1_len,
> > +		char *fullpath, unsigned int fullpath_len,
> > +		unsigned char fanout)
> > +{
> > +	struct tree_content *t = root->tree;
> > +	struct tree_entry *e, leaf;
> > +	unsigned int i, tmp_hex_sha1_len, tmp_fullpath_len, num_notes = 0;
> > +	unsigned char sha1[20];
> > +	char realpath[60];
> > +	int is_note;
> > +
> > +	for (i = 0; i < t->entry_count; i++) {
> > +		e = t->entries[i];
> > +		is_note = (e->versions[1].mode & NOTE_MODE) == NOTE_MODE;
> > +		tmp_hex_sha1_len = hex_sha1_len + e->name->str_len;
> > +		tmp_fullpath_len = fullpath_len;
> > +
> > +		if (tmp_hex_sha1_len <= 40 && e->name->str_len >= 2) {
> > +			memcpy(hex_sha1 + hex_sha1_len, e->name->str_dat,
> > +				e->name->str_len);
> > +			if (tmp_fullpath_len)
> > +				fullpath[tmp_fullpath_len++] = '/';
> > +			memcpy(fullpath + tmp_fullpath_len, e->name->str_dat,
> > +				e->name->str_len);
> > +			tmp_fullpath_len += e->name->str_len;
> > +			assert(tmp_fullpath_len < 60);
> > +			fullpath[tmp_fullpath_len] = '\0';
> > +		} else {
> > +			assert(!is_note);
> > +			continue;
> > +		}
> 
> Are we rejecting a mixed content-tree here?  I thought a notes
> tree was allowed to hold anything, e.g. isn't it ok to put a
> ".gitattributes" file into a notes tree.
> 
> I think we'd do better to have at the top of our loop:
> 
> 	if (!is_note && !S_ISDIR(e->versions[1].mode))
> 		continue;
> 
> so that we ignore non-notes and non-subdirectories which might
> contain notes.

AFAICS, the current code does not reject ".gitattributes", but instead 
simply ignores it presence (i.e. does not change its fanout). However, it 
certainly does some unnecessary work (setting up hex_sha1 and fullpath) 
which is ignored in the bottom part of the loop (where it fails both the "if 
(is_note)" and the following "else if").

However, while adding a test to verify the handling of non-notes, I came 
across an unrelated crasher in the notes.c code. Will send a fix for this 
ASAP.

In any case, I think your proposed if-condition is better, and I will 
rewrite the code accordingly.

> > @@ -2080,8 +2195,10 @@ static void note_change_n(struct branch *b)
> >  			    typename(type), command_buf.buf);
> >  	}
> >
> > -	tree_content_set(&b->branch_tree, sha1_to_hex(commit_sha1), sha1,
> > -		S_IFREG | 0644, NULL);
> > +	construct_path_with_fanout(sha1_to_hex(commit_sha1), fanout, path);
> > +	b->num_notes += adjust_num_notes(&b->branch_tree, path, sha1);
> > +	mode = (is_null_sha1(sha1) ? S_IFREG : NOTE_MODE) | 0644;
> > +	tree_content_set(&b->branch_tree, path, sha1, mode, NULL);
> 
> I wonder if it wouldn't be better to compute the fan out here on
> each put.  That way if an importer drives 2,000,000 notes at once
> to us in a single commit, we don't wind up with a flat 0 fan-out
> tree and trying to perform a linear insert on each one, but instead
> will start to increase the fan out as the number of entries goes up.
> 
> Basically, tree_content_set/remove are O(N) operations on N paths
> in the tree, because their structures aren't necessarily sorted.
> IIRC at one point in time I tried to do this with a binary search but
> gave up and just did it unsorted.  At least using the fan out here
> would help partition the search space dramatically on large inserts.

This is a really good idea, but it's a bit more complicated than that:
An 'N' command may not only add new notes, but also rewrite existing notes, 
and when rewriting an existing note we must take care to _replace_ the old 
note, and not merely adding a new note at a different fanout level. The 
above code implicitly guarantees this, by calling note_change_n() with the 
'old' fanout level (which will cause the new note to overwrite the old note 
in-place).

However, as long as we remember to check for (and remove, if found) the note 
at the old fanout level, we might still be able to place the new note at the 
_current_ fanout level [1], and thus avoid the worst case you describe 
above. Hmm. I need to think some more about this...


Have fun! :)

...Johan


[1] This is actually not _completely_ right: If you have several 'N' 
commands in the same commit that act on the same note, but happen to do so 
in at least two different fanout levels, you will end up with two notes for 
the same object (at least until do_change_note_fanout() arbitrarily 
overwrites one of them with the other). However, this might be such a far-
fetched scenario, that we don't have to worry about it in practice.

-- 
Johan Herland, <johan@herland.net>
www.herland.net

^ permalink raw reply

* [PATCH for v1.6.6] Fix crasher on encountering SHA1-like non-note in notes tree
From: Johan Herland @ 2009-12-03  3:53 UTC (permalink / raw)
  To: gitster; +Cc: git, johan, spearce

When loading a notes tree, the code primarily looks for SHA1-like paths
whose total length (discounting directory separators) are 40 chars
(interpreted as valid note entries) or less (interpreted as subtree
entries that may in turn contain note entries when unpacked).

However, there is an additional condition that must hold for valid
subtree entries: They must be _tree_ objects (duh).

This patch adds an appropriate test for this condition, thereby fixing
the crash that occured when passing a non-tree object to the tree-walk
API.

The patch also adds another selftest verifying correct behaviour of
non-notes in note trees.

Signed-off-by: Johan Herland <johan@herland.net>
---

Junio,

I believe this should be included in v1.6.6. It fixes an existing crasher in
the early part of the notes series.


...Johan

 notes.c                |    2 +
 t/t3304-notes-mixed.sh |  172 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 174 insertions(+), 0 deletions(-)
 create mode 100755 t/t3304-notes-mixed.sh

diff --git a/notes.c b/notes.c
index 50a4672..023adce 100644
--- a/notes.c
+++ b/notes.c
@@ -331,6 +331,8 @@ static void load_subtree(struct leaf_node *subtree, struct int_node *node,
 			hashcpy(l->key_sha1, commit_sha1);
 			hashcpy(l->val_sha1, entry.sha1);
 			if (len < 20) {
+				if (!S_ISDIR(entry.mode))
+					continue; /* entry cannot be subtree */
 				l->key_sha1[19] = (unsigned char) len;
 				type = PTR_TYPE_SUBTREE;
 			}
diff --git a/t/t3304-notes-mixed.sh b/t/t3304-notes-mixed.sh
new file mode 100755
index 0000000..256687f
--- /dev/null
+++ b/t/t3304-notes-mixed.sh
@@ -0,0 +1,172 @@
+#!/bin/sh
+
+test_description='Test notes trees that also contain non-notes'
+
+. ./test-lib.sh
+
+number_of_commits=100
+
+start_note_commit () {
+	test_tick &&
+	cat <<INPUT_END
+commit refs/notes/commits
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+notes
+COMMIT
+
+from refs/notes/commits^0
+deleteall
+INPUT_END
+
+}
+
+verify_notes () {
+	git log | grep "^    " > output &&
+	i=$number_of_commits &&
+	while [ $i -gt 0 ]; do
+		echo "    commit #$i" &&
+		echo "    note for commit #$i" &&
+		i=$(($i-1));
+	done > expect &&
+	test_cmp expect output
+}
+
+test_expect_success "setup: create a couple of commits" '
+
+	test_tick &&
+	cat <<INPUT_END >input &&
+commit refs/heads/master
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+commit #1
+COMMIT
+
+M 644 inline file
+data <<EOF
+file in commit #1
+EOF
+
+INPUT_END
+
+	test_tick &&
+	cat <<INPUT_END >>input &&
+commit refs/heads/master
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+commit #2
+COMMIT
+
+M 644 inline file
+data <<EOF
+file in commit #2
+EOF
+
+INPUT_END
+	git fast-import --quiet <input
+'
+
+test_expect_success "create a notes tree with both notes and non-notes" '
+
+	commit1=$(git rev-parse refs/heads/master^) &&
+	commit2=$(git rev-parse refs/heads/master) &&
+	test_tick &&
+	cat <<INPUT_END >input &&
+commit refs/notes/commits
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+notes commit #1
+COMMIT
+
+N inline $commit1
+data <<EOF
+note for commit #1
+EOF
+
+N inline $commit2
+data <<EOF
+note for commit #2
+EOF
+
+INPUT_END
+	test_tick &&
+	cat <<INPUT_END >>input &&
+commit refs/notes/commits
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+notes commit #2
+COMMIT
+
+M 644 inline foobar/non-note.txt
+data <<EOF
+A non-note in a notes tree
+EOF
+
+N inline $commit2
+data <<EOF
+edited note for commit #2
+EOF
+
+INPUT_END
+	test_tick &&
+	cat <<INPUT_END >>input &&
+commit refs/notes/commits
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+notes commit #3
+COMMIT
+
+N inline $commit1
+data <<EOF
+edited note for commit #1
+EOF
+
+M 644 inline deadbeef
+data <<EOF
+non-note with SHA1-like name
+EOF
+
+M 644 inline de/adbeef
+data <<EOF
+another non-note with SHA1-like name
+EOF
+
+INPUT_END
+	git fast-import --quiet <input &&
+	git config core.notesRef refs/notes/commits
+'
+
+cat >expect <<EXPECT_END
+    commit #2
+    edited note for commit #2
+    commit #1
+    edited note for commit #1
+EXPECT_END
+
+test_expect_success "verify contents of notes" '
+
+	git log | grep "^    " > actual &&
+	test_cmp expect actual
+'
+
+cat >expect_nn1 <<EXPECT_END
+A non-note in a notes tree
+EXPECT_END
+cat >expect_nn2 <<EXPECT_END
+non-note with SHA1-like name
+EXPECT_END
+cat >expect_nn3 <<EXPECT_END
+another non-note with SHA1-like name
+EXPECT_END
+
+test_expect_success "verify contents of non-notes" '
+
+	git cat-file -p refs/notes/commits:foobar/non-note.txt > actual_nn1 &&
+	test_cmp expect_nn1 actual_nn1 &&
+	git cat-file -p refs/notes/commits:deadbeef > actual_nn2 &&
+	test_cmp expect_nn2 actual_nn2 &&
+	git cat-file -p refs/notes/commits:de/adbeef > actual_nn3 &&
+	test_cmp expect_nn3 actual_nn3
+'
+
+test_done
--
1.6.5.3.433.g11067

^ permalink raw reply related

* Re: multiple working directories for long-running builds (was: "git merge" merges too much!)
From: Greg A. Woods @ 2009-12-03  5:11 UTC (permalink / raw)
  To: The Git Mailing List
In-Reply-To: <20091202001020.GF11235@dpotapov.dyndns.org>

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

At Wed, 2 Dec 2009 03:10:21 +0300, Dmitry Potapov <dpotapov@gmail.com> wrote:
Subject: Re: multiple working directories for long-running builds (was:	"git merge" merges too much!)
> 
> My point was that I do not see why you believe "git archive" is more
> expensive than "git clone". Accordingly to Jeff Epler's numbers,
> "git archive" is 20% faster than "git clone"...

Really!?!?!?  You don't see it?  Why is this so hard to understand?
Sorry for my incredulity, but I thought this issue was obvious.

The slightly more expensive "git clone" happens only _ONCE_.  After that
you just run "git pull" I think (plus maybe "git reset --hard"?), but in
any case it's a heck of a lot less I/O and CPU than "git archive".

And of course you skip even the one-time "git clone" operation if you
use the even faster and simpler git-new-workdir script.

"git archive" has to be run _EVERY_ time you need to update a working
directory and it currently has no choice but to toss every bit of the
whole working directory, up from the filesystem, across a pipe, and back
down to the filesystem.  It literally couldn't be more expensive!

Sure, no matter how you do it, updating the working directory might not
always be the biggest part of the operation, but it's insane to use the
most expensive mechanism ever possible when there are far cheaper
alternatives.

BTW, there cannot, and MUST NOT, be any integrity advantage to using
"git archive" over using multiple working directories.  "git archive
branch" must, by definition, produce exactly the same result as if you
did "git checkout branch; rm -rf .git" or else it is buggy.

Note also that the build directories created with git-new-workdir can be
treated as read-only, and perhaps even forced to be read-only by mount
options or maybe just by a corporate policy directive.  (in all projects
I'm working on the source tree can be read-only -- product files are
always generated elsewhere)


> Multiple copies of the same repo is never a problem (except taking some
> disks space).

Exactly -- gigabytes of disk space per copy in the cases I'm concerned
about (i.e. where hard links are impossible).  I've heard that at least
one very large project has an 8GB repository currently.  Three of the
large projects I work on now are about a gigabyte per copy.  That's just
what's under .git too, not including the whole working directory as
well.  I can't even manage a "git clone" from HTTP of one of them
without increasing my default process limits as it is so big and uses up
too much memory.

I guess one could skip the initial more-expensive "git clone" operation
by copying the repo using low-level bit moving commands, like "cp -r" or
whatever, and then tweak the result to make it appear as if it had been
cloned, but even that requires moving gigabytes of data unnecessarily
across what is likely to be a network connection of some sort.

Are you fighting against git-new-workdir, or the concept of multiple
working directories?


> > A major further advantage of multiple working directories is that this
> > eliminates one more point of failure -- i.e. you don't end up with
> > multiple copies of the repo that _should_ be effectively read-only for
> > everything but "push", and perhaps then only to one branch.
> 
> I really do not understand why you say that some copies
> should be effectively read-only... You can start to work on some feature
> at one place (using one repo) and then continue in another place using
> another repo. (Obviously, it will require to fetch changes from the
> first repo, before you will be able to continue, but it is just one
> command). In other words, I really do not understand what are you
> talking about here.

Developers, especially more junior ones, work on code, and they (are
supposed to) spend almost all of their intellectual energy on the issues
to do with creating and modifying code -- they are not expected to be
integration engineers, nor are they expected to be VCS and SCM experts.

The more steps you put in place for them to do, and the more places you
allow them to store changes, etc., etc., etc., the more mistakes that
they will make.

Besides, in some scenarios build directories will be checked out from
integration branches which shouldn't have any direct commits made to
them, especially not to fix a problem in a build.


BTW, pkgsrc has well over 50,000 files, FreeBSD ports is over 100,000.
Neither can really be split in any rational way.

-- 
						Greg A. Woods
						Planix, Inc.

<woods@planix.com>       +1 416 218 0099        http://www.planix.com/

[-- Attachment #2: Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply

* [PATCH v3 1/3] build dashless "bin-wrappers" directory similar to installed bindir
From: Matthew Ogilvie @ 2009-12-03  5:14 UTC (permalink / raw)
  To: git, gitster; +Cc: Matthew Ogilvie
In-Reply-To: <1259817247-3724-1-git-send-email-mmogilvi_git@miniinfo.net>

The new bin-wrappers directory contains wrapper scripts
for executables that will be installed into the standard
bindir.  It explicitly does not contain most dashed-commands.
The scripts automatically set environment variables to run out
of the source tree, not the installed directory.

This will allow running the test suite without dashed commands in
the PATH.  It also provides a simplified way to test run custom
built git executables without installing them first.

bin-wrappers also contains wrappers for some test suite support
executables, where the test suite will soon make use of them.

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
---
 .gitignore      |    1 +
 Makefile        |   49 ++++++++++++++++++++++++++++++++++++-------------
 wrap-for-bin.sh |   15 +++++++++++++++
 3 files changed, 52 insertions(+), 13 deletions(-)
 create mode 100644 wrap-for-bin.sh

diff --git a/.gitignore b/.gitignore
index ac02a58..5d32289 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 /GIT-CFLAGS
 /GIT-GUI-VARS
 /GIT-VERSION-FILE
+/bin-wrappers/
 /git
 /git-add
 /git-add--interactive
diff --git a/Makefile b/Makefile
index 4a1e5bc..378962e 100644
--- a/Makefile
+++ b/Makefile
@@ -427,6 +427,15 @@ ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
 # what 'all' will build but not install in gitexecdir
 OTHER_PROGRAMS = git$X
 
+# what test wrappers are needed and 'install' will install, in bindir
+BINDIR_PROGRAMS_NEED_X += git
+BINDIR_PROGRAMS_NEED_X += git-upload-pack
+BINDIR_PROGRAMS_NEED_X += git-receive-pack
+BINDIR_PROGRAMS_NEED_X += git-upload-archive
+BINDIR_PROGRAMS_NEED_X += git-shell
+
+BINDIR_PROGRAMS_NO_X += git-cvsserver
+
 # Set paths to tools early so that they can be used for version tests.
 ifndef SHELL_PATH
 	SHELL_PATH = /bin/sh
@@ -1714,19 +1723,30 @@ endif
 
 ### Testing rules
 
-TEST_PROGRAMS += test-chmtime$X
-TEST_PROGRAMS += test-ctype$X
-TEST_PROGRAMS += test-date$X
-TEST_PROGRAMS += test-delta$X
-TEST_PROGRAMS += test-dump-cache-tree$X
-TEST_PROGRAMS += test-genrandom$X
-TEST_PROGRAMS += test-match-trees$X
-TEST_PROGRAMS += test-parse-options$X
-TEST_PROGRAMS += test-path-utils$X
-TEST_PROGRAMS += test-sha1$X
-TEST_PROGRAMS += test-sigchain$X
+TEST_PROGRAMS_NEED_X += test-chmtime
+TEST_PROGRAMS_NEED_X += test-ctype
+TEST_PROGRAMS_NEED_X += test-date
+TEST_PROGRAMS_NEED_X += test-delta
+TEST_PROGRAMS_NEED_X += test-dump-cache-tree
+TEST_PROGRAMS_NEED_X += test-genrandom
+TEST_PROGRAMS_NEED_X += test-match-trees
+TEST_PROGRAMS_NEED_X += test-parse-options
+TEST_PROGRAMS_NEED_X += test-path-utils
+TEST_PROGRAMS_NEED_X += test-sha1
+TEST_PROGRAMS_NEED_X += test-sigchain
+
+TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
 
-all:: $(TEST_PROGRAMS)
+test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))
+
+all:: $(TEST_PROGRAMS) $(test_bindir_programs)
+
+bin-wrappers/%: wrap-for-bin.sh
+	@mkdir -p bin-wrappers
+	$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
+	     -e 's|@@BUILD_DIR@@|$(shell pwd)|' \
+	     -e 's|@@PROG@@|$(@F)|' < $< > $@ && \
+	chmod +x $@
 
 # GNU make supports exporting all variables by "export" without parameters.
 # However, the environment gets quite big, and some programs have problems
@@ -1787,11 +1807,13 @@ endif
 gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir))
 export gitexec_instdir
 
+install_bindir_programs := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) $(BINDIR_PROGRAMS_NO_X)
+
 install: all
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
 	$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
-	$(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X git-shell$X git-cvsserver '$(DESTDIR_SQ)$(bindir_SQ)'
+	$(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)'
 	$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
 ifndef NO_PERL
 	$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
@@ -1902,6 +1924,7 @@ clean:
 		$(LIB_FILE) $(XDIFF_LIB)
 	$(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
 	$(RM) $(TEST_PROGRAMS)
+	$(RM) -r bin-wrappers
 	$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
 	$(RM) -r autom4te.cache
 	$(RM) config.log config.mak.autogen config.mak.append config.status config.cache
diff --git a/wrap-for-bin.sh b/wrap-for-bin.sh
new file mode 100644
index 0000000..c5075c9
--- /dev/null
+++ b/wrap-for-bin.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# wrap-for-bin.sh: Template for git executable wrapper scripts
+# to run test suite against sandbox, but with only bindir-installed
+# executables in PATH.  The Makefile copies this into various
+# files in bin-wrappers, substituting
+# @@BUILD_DIR@@ and @@PROG@@.
+
+GIT_EXEC_PATH='@@BUILD_DIR@@'
+GIT_TEMPLATE_DIR='@@BUILD_DIR@@/templates/blt'
+GITPERLLIB='@@BUILD_DIR@@/perl/blib/lib'
+PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
+export GIT_EXEC_PATH GIT_TEMPLATE_DIR GITPERLLIB PATH
+
+exec "${GIT_EXEC_PATH}/@@PROG@@" "$@"
-- 
1.6.6.rc1

^ permalink raw reply related

* [PATCH v3 0/3] bin-wrappers: test without dashed commands in PATH
From: Matthew Ogilvie @ 2009-12-03  5:14 UTC (permalink / raw)
  To: git, gitster; +Cc: Matthew Ogilvie

This patch series allows running the test suite and/or running an
uninstalled build without dashed commands in the PATH.

Changes since version 2:

   merged - The first 3 old patches (fixes to tests to avoid dashed
         commands, and added GIT_TEST_INSTALLED documentation) are
         now in master, so I am not duplicating them here.

   1/3 - Changed to use "@@BUILD_DIR@@" instead of "__GIT_EXEC_DIR__"
         for sed substitution, and to use single quotes around it
         when setting environment variables in wrap-for-bin.sh.
         But this patch still does not really try to handle
         strange characters in $(shell pwd); see earlier email
         thread about this.  (This is newer than pu.)

   2/3 - Fixed a couple of spelling errors in the --with-dashes
         documentation, and avoid "TOP".  (This is newer than pu.)

   3/3 - Replaced wording for running an uninstalled git.
         It now uses Junio's text: no change compared to his
         version of this patch that is currently in pu.

Matthew Ogilvie (3):
  build dashless "bin-wrappers" directory similar to installed bindir
  run test suite without dashed git-commands in PATH
  INSTALL: document a simpler way to run uninstalled builds

 .gitignore      |    1 +
 INSTALL         |   18 +++++++++++-------
 Makefile        |   49 ++++++++++++++++++++++++++++++++++++-------------
 t/README        |    9 +++++++++
 t/test-lib.sh   |   33 +++++++++++++++++++++------------
 wrap-for-bin.sh |   15 +++++++++++++++
 6 files changed, 93 insertions(+), 32 deletions(-)
 create mode 100644 wrap-for-bin.sh

^ permalink raw reply

* [PATCH v3 3/3] INSTALL: document a simpler way to run uninstalled builds
From: Matthew Ogilvie @ 2009-12-03  5:14 UTC (permalink / raw)
  To: git, gitster; +Cc: Matthew Ogilvie
In-Reply-To: <1259817247-3724-3-git-send-email-mmogilvi_git@miniinfo.net>

The new scripts automatically saved in the bin-wrappers directory allow
you to run a build when you have neither installed git nor tweaked
environment variables.  Mention this in INSTALL, along with the slight
performance issue of doing so.

This can be especially handy for manually testing network-invoked git
(from ssh, web servers, or similar), but it is also handy with a plain
command prompt.

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 INSTALL |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/INSTALL b/INSTALL
index be504c9..61086ab 100644
--- a/INSTALL
+++ b/INSTALL
@@ -38,13 +38,17 @@ Issues of note:
    Interactive Tools package still can install "git", but you can build it
    with --disable-transition option to avoid this.
 
- - You can use git after building but without installing if you
-   wanted to.  Various git commands need to find other git
-   commands and scripts to do their work, so you would need to
-   arrange a few environment variables to tell them that their
-   friends will be found in your built source area instead of at
-   their standard installation area.  Something like this works
-   for me:
+ - You can use git after building but without installing if you want
+   to test drive it.  Simply run git found in bin-wrappers directory
+   in the build directory, or prepend that directory to your $PATH.
+   This however is less efficient than running an installed git, as
+   you always need an extra fork+exec to run any git subcommand.
+
+   It is still possible to use git without installing by setting a few
+   environment variables, which was the way this was done
+   traditionally.  But using git found in bin-wrappers directory in
+   the build directory is far simpler.  As a historical reference, the
+   old way went like this:
 
 	GIT_EXEC_PATH=`pwd`
 	PATH=`pwd`:$PATH
-- 
1.6.6.rc1

^ permalink raw reply related

* [PATCH v3 2/3] run test suite without dashed git-commands in PATH
From: Matthew Ogilvie @ 2009-12-03  5:14 UTC (permalink / raw)
  To: git, gitster; +Cc: Matthew Ogilvie
In-Reply-To: <1259817247-3724-2-git-send-email-mmogilvi_git@miniinfo.net>

Only put bin-wrappers in the PATH (not GIT_EXEC_PATH), to emulate the
default installed user environment, and ensure all the programs run
correctly in such an environment.  This is now the default, although
it can be overridden with a --with-dashes test option when running
tests.

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
---
 t/README      |    9 +++++++++
 t/test-lib.sh |   33 +++++++++++++++++++++------------
 2 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/t/README b/t/README
index 4e1d7dd..dcd3ebb 100644
--- a/t/README
+++ b/t/README
@@ -75,6 +75,15 @@ appropriately before running "make".
 	As the names depend on the tests' file names, it is safe to
 	run the tests with this option in parallel.
 
+--with-dashes::
+	By default tests are run without dashed forms of
+	commands (like git-commit) in the PATH (it only uses
+	wrappers from ../bin-wrappers).  Use this option to include
+	the build directory (..) in the PATH, which contains all
+	the dashed forms of commands.  This option is currently
+	implied by other options like --valgrind and
+	GIT_TEST_INSTALLED.
+
 You can also set the GIT_TEST_INSTALLED environment variable to
 the bindir of an existing git installation to test that installation.
 You still need to have built this git sandbox, from which various
diff --git a/t/test-lib.sh b/t/test-lib.sh
index ec3336a..85377c8 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -105,6 +105,8 @@ do
 		verbose=t; shift ;;
 	-q|--q|--qu|--qui|--quie|--quiet)
 		quiet=t; shift ;;
+	--with-dashes)
+		with_dashes=t; shift ;;
 	--no-color)
 		color=; shift ;;
 	--no-python)
@@ -551,19 +553,8 @@ test_done () {
 # Test the binaries we have just built.  The tests are kept in
 # t/ subdirectory and are run in 'trash directory' subdirectory.
 TEST_DIRECTORY=$(pwd)
-if test -z "$valgrind"
+if test -n "$valgrind"
 then
-	if test -z "$GIT_TEST_INSTALLED"
-	then
-		PATH=$TEST_DIRECTORY/..:$PATH
-		GIT_EXEC_PATH=$TEST_DIRECTORY/..
-	else
-		GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path)  ||
-		error "Cannot run git from $GIT_TEST_INSTALLED."
-		PATH=$GIT_TEST_INSTALLED:$TEST_DIRECTORY/..:$PATH
-		GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}
-	fi
-else
 	make_symlink () {
 		test -h "$2" &&
 		test "$1" = "$(readlink "$2")" || {
@@ -625,6 +616,24 @@ else
 	PATH=$GIT_VALGRIND/bin:$PATH
 	GIT_EXEC_PATH=$GIT_VALGRIND/bin
 	export GIT_VALGRIND
+elif test -n "$GIT_TEST_INSTALLED" ; then
+	GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path)  ||
+	error "Cannot run git from $GIT_TEST_INSTALLED."
+	PATH=$GIT_TEST_INSTALLED:$TEST_DIRECTORY/..:$PATH
+	GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}
+else # normal case, use ../bin-wrappers only unless $with_dashes:
+	git_bin_dir="$TEST_DIRECTORY/../bin-wrappers"
+	if ! test -x "$git_bin_dir/git" ; then
+		if test -z "$with_dashes" ; then
+			say "$git_bin_dir/git is not executable; using GIT_EXEC_PATH"
+		fi
+		with_dashes=t
+	fi
+	PATH="$git_bin_dir:$PATH"
+	GIT_EXEC_PATH=$TEST_DIRECTORY/..
+	if test -n "$with_dashes" ; then
+		PATH="$TEST_DIRECTORY/..:$PATH"
+	fi
 fi
 GIT_TEMPLATE_DIR=$(pwd)/../templates/blt
 unset GIT_CONFIG
-- 
1.6.6.rc1

^ permalink raw reply related

* git gsoc money
From: Jeff King @ 2009-12-03  5:22 UTC (permalink / raw)
  To: git

As a result of our participation in the Summer of Code project last
summer and this summer, Google gave the git community some money. Most
of that money went to defraying travel costs to the SoC mentor summit
and the GitTogether, both last year and this year.

However, we still have about $500 USD remaining. Because of the way
Google hands out the money (they want to deal with one entity per
project, and git has no legal entity), all of the remaining money is
being held personally by me.

For accounting and tax reasons, I don't want to hold it later than Dec
31st. So I am soliciting suggestions from the community on what to do
with the money.

Some possibilities are:

  1. Become an affiliated project of an organization like The Software
     Freedom Conservancy or Software in the Public Interest. These are
     non-profit groups to whom we (or anyone else who wants to, for that
     matter) can donate money earmarked for a particular project. They
     handle the accounting and hold the money, and then we get it out
     when we need it for something.

     Of course, then we still have the question of what that "something"
     is. So far, all money has been used for travel aid. Suggestions
     welcome.

     The upsides of this path are that it would handle the issue for
     future years, and it would make it easy for people to donate money
     to git if they wanted to. The downside is that the process may take
     a while, so it may not actually happen in the next month.

     Some relevant links for further reading:

       http://conservancy.softwarefreedom.org/overview/
       http://www.spi-inc.org/treasurer/associated-project-howto.html

  2. Donate the money to some non-profit (by the way, all discussion of
     taxes and non-profit here is with respect to the United States, as
     the money is being held in the US). Possible recipients include a
     software freedom organization like those listed above, or something
     not software-specific like the EFF. It might be nice to contribute
     to projects that help us build git, like curl, libxdiff, or
     asciidoc, but AFAIK we can't do so in a tax-exempt way. gcc/mingw
     is another candidate; we can probably donate to the Free Software
     Foundation for that.

Basically I don't want to hold on to this money, I want it to go
somewhere useful, and I don't want to make a unilateral decision.
Please let me know what people think would be useful.

-Peff

^ permalink raw reply

* Re: [PATCH v2] Add --track option to git clone
From: Björn Steinbrink @ 2009-12-03  5:31 UTC (permalink / raw)
  To: Jeff King; +Cc: Nanako Shiraishi, David Soria Parra, git
In-Reply-To: <20091202190807.GB30778@coredump.intra.peff.net>

On 2009.12.02 14:08:07 -0500, Jeff King wrote:
> And for convenience of the user, you would want a way to avoid repeating
> the name of the "I want to check this out" branch. So either:
> 
>   1. Add "--track foo" as a convenience wrapper for "-f foo -b foo".

Hm, we already have --track for "remote add", and that supports being
supplied multiple times, so I guess for clone, that should work too. But
if track implies -b, having multiple --track seems rather weird. Which
branch head would be created? One for the first --track? Or the last
one? Or one for each? So I'd rather not make --track imply -b.

>   2. If no "-b" is given, the first "-f" is assumed as "-b". So "git
>      clone -f foo" becomes equivalent to David's --track.

Won't work if the first one is -f refs/heads/subst/*:refs/remotes/origin/*

> And of course the name "-f" (for --fetch, if you were wondering) is open
> to suggestion.
> 
> What do you think?

I'd prefer to see just --track for consistency with "remote add". That
could even learn to use globs, but allowing to specify the right side of
the refspec seems wrong given the option name, so it would be more
limited than your -f option.

Björn

^ permalink raw reply

* Re: Git documentation consistency
From: Greg A. Woods @ 2009-12-03  7:22 UTC (permalink / raw)
  To: The Git Mailing List
In-Reply-To: <7vaay096ye.fsf@alter.siamese.dyndns.org>

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

At Wed, 02 Dec 2009 17:34:01 -0800, Junio C Hamano <gitster@pobox.com> wrote:
Subject: Re: Git documentation consistency
> 
> I think you are showing ignorance here, as -? is *not* even close to
> standard, nor even widely used practice at all.

I think I should know something about Unix command line and option
parsers, having used them for some 25 years or so now.  In fact I've
used most every kind of unix that ever was, and I've worked on the
source to more than a few.


>  I somehow doubt your ls
> would respond to "ls -X" any differently from "ls -?", but is giving the
> same canned response to any unknown option.

Indeed.  Whether it is useful for "-?" to give a more detailed summary
than the basic one-line usage message often depends on how complex the
command-line features are.  My preference is for '-?' (and if possible
'-h' as well) to give detailed usage info, though hopefully limited to
just one screen full if possible (though with Git's free use of $PAGER
in many contexts it might be OK to feed longer usage info to $PAGER
too).

So, the basic usage messages for command-line "syntax" problems should
be a one-line summary (following the error message).

If more detail could be useful then '-?' (and if possible '-h') should
display a more detailed usage message.  (and if one line suffices then
'-?' and '-h' don't really have to be treated specially)


> The "usage: ls [-AaBbC...] [file...]" indeed is much better than abstract
> "usage: frotz <options> <args>" that does not list what <options> are, but
> that is a totally different thing.  On that point, I think Peff already
> made a good suggestion of giving the full help text in such a case.

Indeed the abstract content-free "<options>" style message is almost
useless in most cases.

It would also be useful to reflect in the usage message what the driver
program saw as its argv[0], not what the internal command saw:

$ git rebase -X
Usage: /usr/pkg/libexec/git-core//git-rebase [--interactive | -i] [-v] [--onto <newbase>] <upstream> [<branch>]


Or perhaps this could be cleaned up with something as simple as always
stripping off the pathname with the likes of:

     argv0 = (argv0 = strrchr(argv[0], '/')) ? argv0 + 1 : argv[0];

-- 
						Greg A. Woods
						Planix, Inc.

<woods@planix.com>       +1 416 218 0099        http://www.planix.com/

[-- Attachment #2: Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply

* Re: git gsoc money
From: Greg A. Woods @ 2009-12-03  7:41 UTC (permalink / raw)
  To: The Git Mailing List
In-Reply-To: <20091203052220.GA22582@coredump.intra.peff.net>

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

I'm a newcomer here so don't pay too much attention to me.

I would suggest that becoming associated with an existing non-profit
group who do similar kinds of project and financial management for other
similar projects would be the ideal option.  There could be many
benefits further down the road other than just having them act as a bank.

I've heard something good of spi-inc.org before, but
softwarefreedom.org's web site looks a lot better in "links".  :-)

-- 
						Greg A. Woods
						Planix, Inc.

<woods@planix.com>       +1 416 218 0099        http://www.planix.com/

[-- Attachment #2: Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply

* Re: Git documentation consistency
From: Jeff King @ 2009-12-03  7:45 UTC (permalink / raw)
  To: The Git Mailing List
In-Reply-To: <m1NG61U-000kn4C@most.weird.com>

On Thu, Dec 03, 2009 at 02:22:41AM -0500, Greg A. Woods wrote:

> > I think you are showing ignorance here, as -? is *not* even close to
> > standard, nor even widely used practice at all.
> 
> I think I should know something about Unix command line and option
> parsers, having used them for some 25 years or so now.  In fact I've
> used most every kind of unix that ever was, and I've worked on the
> source to more than a few.

I don't want to nitpick, because the main thrust of your point (that
"git foo --bogus" should show a more useful message) is not affected by
this subpoint at all.  But if we are considering special-casing "-?", I
would like to see some evidence that it is actually in use.

I can't seem to find it respected anywhere, as shown below (and note
that yes, some of this output does show a useful help message, but that
is because --bogus would show the same message, and I am not disputing
that we should handle that case):

# My linux box
$ uname -sr
Linux 2.6.31-1-686
$ ls -?
ls: invalid option -- '?'
Try `ls --help' for more information.

# Solaris
$ uname -sr
SunOS 5.8
$ /bin/ls -?
/bin/ls: illegal option -- ?
usage: ls -1RaAdCxmnlogrtucpFbqisfL [files]
$ /usr/ucb/ls -? ;# appears to ignore bogus options entirely?
foo
$ /usr/ucb/fold -?
/usr/ucb/fold: illegal option -- ?
Usage: fold [-bs] [-w width | -width ] [file...]
$ /usr/xpg4/bin/ls -?
/usr/xpg4/bin/ls: illegal option -- ?
usage: ls -1RaAdCxmnlogrtucpFbqisfL [files]
$ /usr/xpg6/bin/ls -?
bash: /usr/xpg6/bin/ls: No such file or directory

# AIX
$ uname -svr
AIX 1 6
$ /bin/ls -?
/bin/ls: illegal option -- ?
usage: ls [-1ACFHLNRabcdefgilmnopqrstuxEUX] [File...]

So what systems _do_ treat "-?" specially?

-Peff

^ permalink raw reply

* Re: [PATCH] git-pull.sh: Fix call to git-merge for new command   format
From: Michael J Gruber @ 2009-12-03  8:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Horst H. von Brand, git
In-Reply-To: <7viqcpgtbf.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 02.12.2009 18:49:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>>> Yes.  Anything that sets GIT_EXEC_PATH correctly can use git-foo form.
>>
>> I know they can. That was in the part you snipped ;)
> 
> You asked about the presense of "a policy", and you got an answer.

I guess that was a language issue (on both sides) then, since "can"
could be "is able to" as well as "is allowed to", and I read your answer
in the former sense; the latter makes it a policy.

>> The questions is: Should they? Should we avoid mixing both forms in one
>> script?
> 
> Should we avoid it?  Yes but not very enthusiastically.  We should make
> sure that new invocations anybody adds use dashless form, but I would
> recommend against a "let's remove use of dashed form" patch _unless_ you
> find a time when the project is really quiet and there is nothing else
> going on.

OK, that's all I wanted to know. Thanks.

Michael

^ permalink raw reply

* [PATCH RESEND] git config: clarify bool types
From: Felipe Contreras @ 2009-12-03  8:21 UTC (permalink / raw)
  To: git; +Cc: Felipe Contreras

The value is what it is, the --bool and --bool-or-int options don't
specify the value type, just how it is interpreted. For example: a value
of '1' can be interpreted as 'true'.

Comments by Michael J Gruber.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin-config.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin-config.c b/builtin-config.c
index a2d656e..d81928c 100644
--- a/builtin-config.c
+++ b/builtin-config.c
@@ -66,9 +66,9 @@ static struct option builtin_config_options[] = {
 	OPT_STRING(0, "get-color", &get_color_slot, "slot", "find the color configured: [default]"),
 	OPT_STRING(0, "get-colorbool", &get_colorbool_slot, "slot", "find the color setting: [stdout-is-tty]"),
 	OPT_GROUP("Type"),
-	OPT_BIT(0, "bool", &types, "value is \"true\" or \"false\"", TYPE_BOOL),
+	OPT_BIT(0, "bool", &types, "value is interpreted as a boolean (\"true\" or \"false\")", TYPE_BOOL),
 	OPT_BIT(0, "int", &types, "value is decimal number", TYPE_INT),
-	OPT_BIT(0, "bool-or-int", &types, "value is --bool or --int", TYPE_BOOL_OR_INT),
+	OPT_BIT(0, "bool-or-int", &types, "value is interpreted either as --bool or --int", TYPE_BOOL_OR_INT),
 	OPT_GROUP("Other"),
 	OPT_BOOLEAN('z', "null", &end_null, "terminate values with NUL byte"),
 	OPT_END(),
-- 
1.6.6.rc1.1.ge4e9b

^ permalink raw reply related


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