Git development
 help / color / mirror / Atom feed
* Re: git submodules
From: Nanako Shiraishi @ 2009-10-17 22:30 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Git Mailing List, Steven Noonan, crawl-ref-discuss
In-Reply-To: <m3tyxydj8f.fsf@localhost.localdomain>

Quoting Jakub Narebski <jnareb@gmail.com>

> Steven Noonan <steven@uplinklabs.net> writes:
>
>> We're using git submodules for the contributing libraries. When I
>> commit changes to those contribs, it correctly shows in the parent
>> repository that those folders have different revisions than what's
>> currently committed. However, if someone pulls those changes, it
>> doesn't automatically update the contribs to match the committed
>> version. But doing a pull or merge _should_ update the working tree to
>> match the committed versions. It does with file data, so why not
>> update the submodules? Especially if the submodule revision matched
>> the committed version -before- the pull. Why are we forced into using
>> 'git submodule update'?
>
> Because you might want not to use most current version of submodule,
> so git-pull shouldn't update submodules by default.  And because
> git-pull didn't learn --recursive option yet.

I don't think your description is correct. Steven is talking about what the command should do by default. If you checked out the current superproject, by default you should get the submodule that matches. If you don't want the most current version, you can checkout an older submodule yourself.

You may want to follow this discussion:

  http://thread.gmane.org/gmane.comp.version-control.git/130155/focus=130330

After stating that he isn't against the idea to make it automatic, Junio describes what needs to be done for it to happen and what are the corner cases that needs to be treated with care.

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

^ permalink raw reply

* Re: [PATCH] Proof-of-concept patch to remember what the detached HEAD was
From: Julian Phillips @ 2009-10-17 22:28 UTC (permalink / raw)
  To: Björn Steinbrink
  Cc: Nicolas Pitre, Junio C Hamano, Daniel Barkalow, James Pickens,
	Jeff King, Jay Soffian, Git Mailing List
In-Reply-To: <20091017174843.GA16251@atjola.homenet>

On Sat, 17 Oct 2009, Bj?rn Steinbrink wrote:

> On 2009.10.17 18:35:38 +0100, Julian Phillips wrote:
>> On Sat, 17 Oct 2009, Bj?rn Steinbrink wrote:
>>> Do you have multiple (annotated) tags for the same commit?
>>
>> Potentially, yes.  Releasing isn't the only thing that requires
>> keeping track of things.  It's even possible that the person
>> creating the newer tag doesn't yet know that a release tag has been
>> applied if the person who applied it hasn't yet pushed it back.
>
> OK, I'd consider that namespace pollution, as things like
> "this-version-sucks" doesn't seem like it show go into public repos, but
> anyway. If your release tags fix into a certain "unique" format, you
> could use describe with --match, like:
> git describe --match 'v[0-9]*'

Well - that only helps if we only ever build the release tags.  Which 
isn't the case.  The other tags are there for similar purposes and also 
should go into the version string - but only when they were the tag 
checked out.

Is it really that unreasonable to want to know exactly what it was that 
was checked out?  It's one of the few things that I miss from Subversion.

-- 
Julian

  ---
printk(KERN_INFO MYNAM ": English readable SCSI-3 strings enabled :-)\n");
         linux-2.6.6/drivers/message/fusion/mptbase.c

^ permalink raw reply

* [ANNOUNCE] GIT 1.6.5.1
From: Junio C Hamano @ 2009-10-18  1:04 UTC (permalink / raw)
  To: git

The latest maintenance release GIT 1.6.5.1 is available at the
usual places:

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

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

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

  RPMS/$arch/git-*-1.6.5.1-1.fc9.$arch.rpm	(RPM)

GIT v1.6.5.1 Release Notes
==========================

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

 * An corrupt pack could make codepath to read objects into an
   infinite loop.

 * Download throughput display was always shown in KiB/s but on fast links
   it is more appropriate to show it in MiB/s.

 * "git grep -f filename" used uninitialized variable and segfaulted.

 * "git clone -b branch" gave a wrong commit object name to post-checkout
   hook.

 * "git pull" over http did not work on msys.

Other minor documentation updates are included.

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

Changes since v1.6.5 are as follows:

Björn Steinbrink (1):
      clone: Supply the right commit hash to post-checkout when -b is used

Johannes Sixt (1):
      remote-curl: add missing initialization of argv0_path

Junio C Hamano (1):
      GIT 1.6.5.1

Matt Kraai (1):
      grep: do not segfault when -f is used

Miklos Vajna (1):
      git-stash documentation: mention default options for 'list'

Nicolas Pitre (1):
      change throughput display units with fast links

Shawn O. Pearce (1):
      sha1_file: Fix infinite loop when pack is corrupted

^ permalink raw reply

* How to revert one of multiple merges
From: Bill Lear @ 2009-10-18  2:31 UTC (permalink / raw)
  To: git

Branch A, B, C each have 20 commits, 0-19.

Branch v1.0.0 created, then merge of A, B, C performed.

After testing, we realize that the branch B is not ready for
production release and we'd like to remove it from branch
v1.0.0.

If I do

% git merge A B C

I get a single commit:

% git log -p

commit 1644a0b98c01869aa83e59aa41374c22098c47b6
[...]
Date:   Fri Oct 16 09:52:32 2009 -0500

    Merge branches 'A', 'B' and 'C' into v1.0.0

[20 x 3 commits]

If I do

% git merge A
% git merge B
% git merge C

Then:

% git log -p

commit 8946edd381384d0882221c87b5b3b7bf47127d70
[...]
Date:   Sat Oct 17 21:28:36 2009 -0500

    Merge branch 'B' into v1.0.0

commit 076ed422443e3684e564f7cae2b92e4538088ae6
[...]
Date:   Sat Oct 17 21:28:35 2009 -0500

    Merge branch 'A' into v1.0.0

but no "Merge branch 'C' into v1.0.0".

And so, I'm faced with git rebase -i posing some unanswerable questions
to our release manager.  She cannot easily remove B from the merge after
doint either merge A B C, or merge A, merge B, merge C.

Can anyone help?


Bill

^ permalink raw reply

* Re: [PATCH 0/3] Generalized "string function" syntax
From: Junio C Hamano @ 2009-10-18  4:18 UTC (permalink / raw)
  To: René Scharfe; +Cc: git
In-Reply-To: <4ADA3153.7070606@lsrfire.ath.cx>

René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:

> Junio C Hamano schrieb:
>> I mentioned an idea to enhance the pretty=format language with a
>> string function syntax that people can extend by adding new functions
>> in one of the "What's cooking" messages earlier.  The general syntax
>> would be like
>> 
>> %[function(args...)any string here%]
>> 
>> where "any string here" part would have the usual pretty=format
>> strings. E.g.  git show -s --format='%{w(72,8,4)%s%+b%]' should give
>> you a line wrapped commit log message if w(width,in1,in2) is such a
>> function.
>
> I pondered line wrapping with format strings briefly a long time ago, and
> I always considered it to be more similar to a colour, i.e. a state that
> one can change and that is applied to all following text until the next
> state change.  (Except that it's always reset at the end of the format
> string.)  The example above would then turn into '%w(72,8,4)%s%+b'.

As a syntax to express "wrapping" behaviour alone, I think this is much
simpler and more superiour.  I guess with this if you want to wrap
something to 72 columns and then wrap something else to 66 columns, you
would write '%w(72,8,4)something%w(66,8,4)something else', right?

I used %] only for two reasons.

 - Without an explicit "here it ends", I couldn't come up with a good way
   to express '%[w(72,8,4)something%]something else'.  IOW, how I can say
   "wrap something to 72 columns and then place something else without any
   wrapping"?
   
 - When we need to support more than one string function like this, it is
   unclear what '%f()one string%g()another one' in your syntax means.
   Does it mean '%[f()one string%]%[g()another one%]' (i.e. concatenate
   the result of applying string function f to 'one string' and the result
   of applying string function g to 'another one')?  Or does it mean
   '%[f()one string%[g()another one%]%]' (apply 'f' to concatenation of
   'one string' and the result of applying 'g' to 'another one')?

^ permalink raw reply

* Re: [PATCH v3.1 3/5] Introduce new pretty formats %g[sdD] for reflog information
From: Jeff King @ 2009-10-18  7:18 UTC (permalink / raw)
  To: Thomas Rast; +Cc: Junio C Hamano, Jef Driesen, Nanako Shiraishi, git
In-Reply-To: <e0ab6923eb4057bcbc8e97980dad5e4a37e53067.1255790816.git.trast@student.ethz.ch>

On Sat, Oct 17, 2009 at 04:48:11PM +0200, Thomas Rast wrote:

> > +NOTE: Some placeholders may depend on other options given to the
> > +revision traversal engine. For example, the `%g*` reflog options will
> > +insert an empty string unless we are traversing reflog entries (e.g., by
> > +`git log -g`). The `%d` placeholder will use the "short" decoration
> > +format if `--decorate` was not already provided on the command line.
> 
> Sure.  I figured it was obvious enough, but since you already went to
> the lengths of documenting the exact behaviour of %d, I squashed it
> and adjusted the acknowledgement in the commit message accordingly.

If the consensus (or Junio's decision when applying) is that we don't
need it, I don't mind if my suggestion is scrapped (or reworded).

-Peff

^ permalink raw reply

* Re: [PATCH/RFC] builtin-checkout: suggest creating local branch when appropriate to do so
From: Junio C Hamano @ 2009-10-18  7:58 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Jay Soffian, git
In-Reply-To: <alpine.DEB.1.00.0910052314580.4985@pacific.mpi-cbg.de>

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Actually, we should really think long and hard why we should not 
> automatically check out the local branch "next" in that case.

While people were thinking long and hard, I've spent some quality time
having fun with these patches, and realized that if we limit the scope of
the change to make sure that we only change the behaviour of a case where
we refused to do anything, this is not even something we need to think
long nor hard after all.

At least from the maintainer's point of view, that is.

I on the other hand do agree that we need to think long and hard when it
comes to the matter of explaining this to the users, though.  I couldn't
come up with a good (re-)ordering of the documentation to fit this new
"short-cut" into the manpage.

A three-patch series will follow shortly.

^ permalink raw reply

* [PATCH 1/3] check_filename(): make verify_filename() callable without dying
From: Junio C Hamano @ 2009-10-18  8:00 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Jay Soffian
In-Reply-To: <7vzl7pyvzl.fsf@alter.siamese.dyndns.org>

Make it possible to invole the logic of verify_filename() to make sure the
pathname arguments are unambiguous without actually dying.  The caller may
want to do something different.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 cache.h |    1 +
 setup.c |   38 ++++++++++++++++++++------------------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/cache.h b/cache.h
index 96840c7..71a731d 100644
--- a/cache.h
+++ b/cache.h
@@ -396,6 +396,7 @@ extern const char *setup_git_directory_gently(int *);
 extern const char *setup_git_directory(void);
 extern const char *prefix_path(const char *prefix, int len, const char *path);
 extern const char *prefix_filename(const char *prefix, int len, const char *path);
+extern int check_filename(const char *prefix, const char *name);
 extern void verify_filename(const char *prefix, const char *name);
 extern void verify_non_filename(const char *prefix, const char *name);
 
diff --git a/setup.c b/setup.c
index 029371e..f67250b 100644
--- a/setup.c
+++ b/setup.c
@@ -61,6 +61,19 @@ const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)
 	return path;
 }
 
+int check_filename(const char *prefix, const char *arg)
+{
+	const char *name;
+	struct stat st;
+
+	name = prefix ? prefix_filename(prefix, strlen(prefix), arg) : arg;
+	if (!lstat(name, &st))
+		return 1; /* file exists */
+	if (errno == ENOENT || errno == ENOTDIR)
+		return 0; /* file does not exist */
+	die_errno("failed to stat '%s'", arg);
+}
+
 /*
  * Verify a filename that we got as an argument for a pathspec
  * entry. Note that a filename that begins with "-" never verifies
@@ -70,18 +83,12 @@ const char *prefix_filename(const char *pfx, int pfx_len, const char *arg)
  */
 void verify_filename(const char *prefix, const char *arg)
 {
-	const char *name;
-	struct stat st;
-
 	if (*arg == '-')
 		die("bad flag '%s' used after filename", arg);
-	name = prefix ? prefix_filename(prefix, strlen(prefix), arg) : arg;
-	if (!lstat(name, &st))
+	if (check_filename(prefix, arg))
 		return;
-	if (errno == ENOENT)
-		die("ambiguous argument '%s': unknown revision or path not in the working tree.\n"
-		    "Use '--' to separate paths from revisions", arg);
-	die_errno("failed to stat '%s'", arg);
+	die("ambiguous argument '%s': unknown revision or path not in the working tree.\n"
+	    "Use '--' to separate paths from revisions", arg);
 }
 
 /*
@@ -91,19 +98,14 @@ void verify_filename(const char *prefix, const char *arg)
  */
 void verify_non_filename(const char *prefix, const char *arg)
 {
-	const char *name;
-	struct stat st;
-
 	if (!is_inside_work_tree() || is_inside_git_dir())
 		return;
 	if (*arg == '-')
 		return; /* flag */
-	name = prefix ? prefix_filename(prefix, strlen(prefix), arg) : arg;
-	if (!lstat(name, &st))
-		die("ambiguous argument '%s': both revision and filename\n"
-		    "Use '--' to separate filenames from revisions", arg);
-	if (errno != ENOENT && errno != ENOTDIR)
-		die_errno("failed to stat '%s'", arg);
+	if (!check_filename(prefix, arg))
+		return;
+	die("ambiguous argument '%s': both revision and filename\n"
+	    "Use '--' to separate filenames from revisions", arg);
 }
 
 const char **get_pathspec(const char *prefix, const char **pathspec)
-- 
1.6.5.1.95.g09fbd

^ permalink raw reply related

* [PATCH 2/3] DWIM "git checkout frotz" to "git checkout -b frotz origin/frotz"
From: Junio C Hamano @ 2009-10-18  8:01 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Jay Soffian
In-Reply-To: <7vzl7pyvzl.fsf@alter.siamese.dyndns.org>

When 'frotz' is not a valid object name nor a tracked filename,
we used to complain and failed this command.  When there is only
one remote that has 'frotz' as one of its tracking branches, we can
DWIM it as a request to create a local branch 'frotz' forking from
the matching remote tracking branch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin-checkout.c |   60 +++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/builtin-checkout.c b/builtin-checkout.c
index d050c37..fb7e68a 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -572,6 +572,40 @@ static int interactive_checkout(const char *revision, const char **pathspec,
 	return run_add_interactive(revision, "--patch=checkout", pathspec);
 }
 
+struct tracking_name_data {
+	const char *name;
+	char *remote;
+	int unique;
+};
+
+static int check_tracking_name(const char *refname, const unsigned char *sha1,
+			       int flags, void *cb_data)
+{
+	struct tracking_name_data *cb = cb_data;
+	const char *slash;
+
+	if (prefixcmp(refname, "refs/remotes/"))
+		return 0;
+	slash = strchr(refname + 13, '/');
+	if (!slash || strcmp(slash + 1, cb->name))
+		return 0;
+	if (cb->remote) {
+		cb->unique = 0;
+		return 0;
+	}
+	cb->remote = xstrdup(refname);
+	return 0;
+}
+
+static const char *unique_tracking_name(const char *name)
+{
+	struct tracking_name_data cb_data = { name, NULL, 1 };
+	for_each_ref(check_tracking_name, &cb_data);
+	if (cb_data.unique)
+		return cb_data.remote;
+	free(cb_data.remote);
+	return NULL;
+}
 
 int cmd_checkout(int argc, const char **argv, const char *prefix)
 {
@@ -630,8 +664,6 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 		opts.new_branch = argv0 + 1;
 	}
 
-	if (opts.track == BRANCH_TRACK_UNSPECIFIED)
-		opts.track = git_branch_track;
 	if (conflict_style) {
 		opts.merge = 1; /* implied */
 		git_xmerge_config("merge.conflictstyle", conflict_style, NULL);
@@ -655,6 +687,11 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 	 *   With no paths, if <something> is a commit, that is to
 	 *   switch to the branch or detach HEAD at it.
 	 *
+	 *   With no paths, if <something> is _not_ a commit, no -t nor -b
+	 *   was given, and there is a tracking branch whose name is
+	 *   <something> in one and only one remote, then this is a short-hand
+	 *   to fork local <something> from that remote tracking branch.
+	 *
 	 *   Otherwise <something> shall not be ambiguous.
 	 *   - If it's *only* a reference, treat it like case (1).
 	 *   - If it's only a path, treat it like case (2).
@@ -677,7 +714,20 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 		if (get_sha1(arg, rev)) {
 			if (has_dash_dash)          /* case (1) */
 				die("invalid reference: %s", arg);
-			goto no_reference;          /* case (3 -> 2) */
+			if (!patch_mode &&
+			    opts.track == BRANCH_TRACK_UNSPECIFIED &&
+			    !opts.new_branch &&
+			    !check_filename(NULL, arg) &&
+			    argc == 1) {
+				const char *remote = unique_tracking_name(arg);
+				if (!remote || get_sha1(remote, rev))
+					goto no_reference;
+				opts.new_branch = arg;
+				arg = remote;
+				/* DWIMmed to create local branch */
+			}
+			else
+				goto no_reference;
 		}
 
 		/* we can't end up being in (2) anymore, eat the argument */
@@ -715,6 +765,10 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 	}
 
 no_reference:
+
+	if (opts.track == BRANCH_TRACK_UNSPECIFIED)
+		opts.track = git_branch_track;
+
 	if (argc) {
 		const char **pathspec = get_pathspec(prefix, argv);
 
-- 
1.6.5.1.95.g09fbd

^ permalink raw reply related

* [PATCH 3/3] git checkout --nodwim
From: Junio C Hamano @ 2009-10-18  8:01 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Jay Soffian
In-Reply-To: <7vzl7pyvzl.fsf@alter.siamese.dyndns.org>

Porcelains may want to make sure their calls to "git checkout" will
reliably fail regardless of the presense of random remote tracking
branches by the new DWIMmery introduced.

Luckily all existing in-tree callers have extra checks to make sure they
feed local branch name when they want to switch, or they explicitly ask
to detach HEAD at the given commit, so there is no need to add this option
for them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin-checkout.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/builtin-checkout.c b/builtin-checkout.c
index fb7e68a..6ec9b83 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -616,6 +616,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 	struct tree *source_tree = NULL;
 	char *conflict_style = NULL;
 	int patch_mode = 0;
+	int dwim_new_local_branch = 1;
 	struct option options[] = {
 		OPT__QUIET(&opts.quiet),
 		OPT_STRING('b', NULL, &opts.new_branch, "new branch", "branch"),
@@ -631,6 +632,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 		OPT_STRING(0, "conflict", &conflict_style, "style",
 			   "conflict style (merge or diff3)"),
 		OPT_BOOLEAN('p', "patch", &patch_mode, "select hunks interactively"),
+		OPT_SET_INT(0, "nodwim", &dwim_new_local_branch,
+			    "do not dwim local branch creation", 0),
 		OPT_END(),
 	};
 	int has_dash_dash;
@@ -715,6 +718,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 			if (has_dash_dash)          /* case (1) */
 				die("invalid reference: %s", arg);
 			if (!patch_mode &&
+			    dwim_new_local_branch &&
 			    opts.track == BRANCH_TRACK_UNSPECIFIED &&
 			    !opts.new_branch &&
 			    !check_filename(NULL, arg) &&
-- 
1.6.5.1.95.g09fbd

^ permalink raw reply related

* Re: [PATCH 0/3] Generalized "string function" syntax
From: René Scharfe @ 2009-10-18  8:24 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7v63ad5o8p.fsf@alter.siamese.dyndns.org>

Junio C Hamano schrieb:
> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
> 
>> Junio C Hamano schrieb:
>>> I mentioned an idea to enhance the pretty=format language with a
>>> string function syntax that people can extend by adding new functions
>>> in one of the "What's cooking" messages earlier.  The general syntax
>>> would be like
>>>
>>> %[function(args...)any string here%]
>>>
>>> where "any string here" part would have the usual pretty=format
>>> strings. E.g.  git show -s --format='%{w(72,8,4)%s%+b%]' should give
>>> you a line wrapped commit log message if w(width,in1,in2) is such a
>>> function.
>> I pondered line wrapping with format strings briefly a long time ago, and
>> I always considered it to be more similar to a colour, i.e. a state that
>> one can change and that is applied to all following text until the next
>> state change.  (Except that it's always reset at the end of the format
>> string.)  The example above would then turn into '%w(72,8,4)%s%+b'.
> 
> As a syntax to express "wrapping" behaviour alone, I think this is much
> simpler and more superiour.  I guess with this if you want to wrap
> something to 72 columns and then wrap something else to 66 columns, you
> would write '%w(72,8,4)something%w(66,8,4)something else', right?

That's right.

> I used %] only for two reasons.
> 
>  - Without an explicit "here it ends", I couldn't come up with a good way
>    to express '%[w(72,8,4)something%]something else'.  IOW, how I can say
>    "wrap something to 72 columns and then place something else without any
>    wrapping"?

My patch makes '%w()' reset the wrapping parameters to their defaults.

>  - When we need to support more than one string function like this, it is
>    unclear what '%f()one string%g()another one' in your syntax means.
>    Does it mean '%[f()one string%]%[g()another one%]' (i.e. concatenate
>    the result of applying string function f to 'one string' and the result
>    of applying string function g to 'another one')?  Or does it mean
>    '%[f()one string%[g()another one%]%]' (apply 'f' to concatenation of
>    'one string' and the result of applying 'g' to 'another one')?

I was going to say that we already have something like that with %C, and
that the natural way (to me) is to apply them both, independently.  Case
modification functions (upper, lower, capitalized) could be treated the
same way -- as state changes (like pressing caps lock when typing text).

Which other text functions are we going to add which would break this
model?  The only thing I can think of right now is nesting such
functions themselves, e.g. when indenting a list in an indented
sub-paragraph in an indented paragraph.  Useful?

But then something else hit me: the line wrap function needs to consider
colour codes as having a length of zero.  Ugh.

René

^ permalink raw reply

* Re: [PATCH v3.1 3/5] Introduce new pretty formats %g[sdD] for reflog information
From: Nanako Shiraishi @ 2009-10-18 10:34 UTC (permalink / raw)
  To: Jeff King; +Cc: Thomas Rast, Junio C Hamano, Jef Driesen, Nanako Shiraishi, git
In-Reply-To: <20091018071829.GA7748@coredump.intra.peff.net>

Quoting Jeff King <peff@peff.net>

> On Sat, Oct 17, 2009 at 04:48:11PM +0200, Thomas Rast wrote:
>
>> > +NOTE: Some placeholders may depend on other options given to the
>> > +revision traversal engine. For example, the `%g*` reflog options will
>> > +insert an empty string unless we are traversing reflog entries (e.g., by
>> > +`git log -g`). The `%d` placeholder will use the "short" decoration
>> > +format if `--decorate` was not already provided on the command line.
>> 
>> Sure.  I figured it was obvious enough, but since you already went to
>> the lengths of documenting the exact behaviour of %d, I squashed it
>> and adjusted the acknowledgement in the commit message accordingly.
>
> If the consensus (or Junio's decision when applying) is that we don't
> need it, I don't mind if my suggestion is scrapped (or reworded).

I think your clarification is a good addition.

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

^ permalink raw reply

* Re: [PATCH 2/3] DWIM "git checkout frotz" to "git checkout -b frotz origin/frotz"
From: Nanako Shiraishi @ 2009-10-18 10:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Schindelin, Jay Soffian
In-Reply-To: <7vaazpxha4.fsf_-_@alter.siamese.dyndns.org>

Quoting Junio C Hamano <gitster@pobox.com>

> When 'frotz' is not a valid object name nor a tracked filename,
> we used to complain and failed this command.  When there is only
> one remote that has 'frotz' as one of its tracking branches, we can
> DWIM it as a request to create a local branch 'frotz' forking from
> the matching remote tracking branch.

In the subject you used 'git checkout -b frotz origin/frotz'. Did you forget to say '-t'?

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

^ permalink raw reply

* Re: [PATCH 2/3] DWIM "git checkout frotz" to "git checkout -b frotz origin/frotz"
From: Björn Steinbrink @ 2009-10-18 12:00 UTC (permalink / raw)
  To: Nanako Shiraishi; +Cc: Junio C Hamano, git, Johannes Schindelin, Jay Soffian
In-Reply-To: <20091018193448.6117@nanako3.lavabit.com>

On 2009.10.18 19:34:48 +0900, Nanako Shiraishi wrote:
> Quoting Junio C Hamano <gitster@pobox.com>
> 
> > When 'frotz' is not a valid object name nor a tracked filename,
> > we used to complain and failed this command.  When there is only
> > one remote that has 'frotz' as one of its tracking branches, we can
> > DWIM it as a request to create a local branch 'frotz' forking from
> > the matching remote tracking branch.
> 
> In the subject you used 'git checkout -b frotz origin/frotz'. Did you
> forget to say '-t'?

Hm, the DWIMmery only triggers when opts.track is
BRANCH_TRACK_UNSPECIFIED, i.e. -t was not used. And it doesn't change
opts.track when it DWIMs, so it respects branch.autosetupmerge, which
would be overriden by -t. So it seems correct that -t is not in there.

Björn

^ permalink raw reply

* Re: [PATCH 3/3] git checkout --nodwim
From: Alex Riesen @ 2009-10-18 12:40 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Schindelin, Jay Soffian
In-Reply-To: <7v63adxh9a.fsf_-_@alter.siamese.dyndns.org>

On Sun, Oct 18, 2009 at 10:01, Junio C Hamano <gitster@pobox.com> wrote:
> +               OPT_SET_INT(0, "nodwim", &dwim_new_local_branch,
> +                           "do not dwim local branch creation", 0),

Isn't there a special negation support for --no-something in parse-options?

^ permalink raw reply

* Creating something like increasing revision numbers
From: Norbert Preining @ 2009-10-18 14:41 UTC (permalink / raw)
  To: git

Dear all,

(please Cc)

I am managing some of my projects with git and I am quite happy about it.

There is another project I am working that is quite big, the subversion
checkout is about 14Gb. Doing svn up is a pain, it has to open tens of
thousands of files and directories traversing the whole tree, trashing
the fs cache and taking ages.

My idea was to move to git, from what I read it should be more capable
in handling these type of projects.

Now, there is one show-stopper I see. From our repository we create a
set of "packages", and the maximum of the "last-changed" revisions of
the contained files determine the "version" of the package. This 
guarantees that any change in a file will increase the revision number
of the package (some tricks for removals have to be done). This is necessary
since we are distributing the packages from servers and the version number
pf a package determines whether it should be upgraded (well known concept).

Now my question, is there any way to set up something similar with git?

My idea is that git - like subversion - could (if asked to) count each
commit (global to the repository, irrelevant of the branch) and give it
a version number. Since we all will use a bare repository on a server
and pull/push from/to there, I think that something similar could be possible.

So, before I delve into more gitty-nitty conversion, let me know if
there is any chance for that, or we should stay with subversion.

Thanks a lot and all the best

Norbert

PS: for those interested, it is TeX Live: www.tug.org/texlive

-------------------------------------------------------------------------------
Dr. Norbert Preining                                        Associate Professor
JAIST Japan Advanced Institute of Science and Technology   preining@jaist.ac.jp
Vienna University of Technology                               preining@logic.at
Debian Developer (Debian TeX Task Force)                    preining@debian.org
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
YONKERS (n.)
(Rare.) The combined thrill of pain and shame when being caught in
public plucking your nostril-hairs and stuffing them into your
side-pocket.
			--- Douglas Adams, The Meaning of Liff

^ permalink raw reply

* Re: Creating something like increasing revision numbers
From: Johan Herland @ 2009-10-18 15:03 UTC (permalink / raw)
  To: Norbert Preining; +Cc: git
In-Reply-To: <20091018144158.GA9789@gandalf.dynalias.org>

On Sunday 18 October 2009, Norbert Preining wrote:
> Now, there is one show-stopper I see. From our repository we create a
> set of "packages", and the maximum of the "last-changed" revisions of
> the contained files determine the "version" of the package. This
> guarantees that any change in a file will increase the revision number
> of the package (some tricks for removals have to be done). This is
>  necessary since we are distributing the packages from servers and the
>  version number pf a package determines whether it should be upgraded
>  (well known concept).
> 
> Now my question, is there any way to set up something similar with git?
> 
> My idea is that git - like subversion - could (if asked to) count each
> commit (global to the repository, irrelevant of the branch) and give it
> a version number. Since we all will use a bare repository on a server
> and pull/push from/to there, I think that something similar could be
>  possible.
> 
> So, before I delve into more gitty-nitty conversion, let me know if
> there is any chance for that, or we should stay with subversion.

A global, increasing version number ala SVN is fundamentally impossible in 
any distributed version control system (like Git).

However, you can get a useful version specifier from the "git describe" 
command. It will give you back something like the following:

    $ git describe
    v1.0.4-14-g2414721

where the "v1.0.4" part is the last tag that the current state is based on, 
the "14" part is the number of commit between that tag and the current 
state, and the "2414721" is the abbreviated object name (SHA1 id) for the 
current commit itself.

This is somewhat more complex than a simple version number, but guarantees a 
globally unique name for your current state that works in a distributed 
environment.

Also, I find "v1.0.4-14..." (i.e. 14 commits since v1.0.4) much more useful 
than, say, "12534" (i.e. 12534 commits since the start of the project).

See 'git help describe for more info'


Have fun! :)

...Johan

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

^ permalink raw reply

* Re: Creating something like increasing revision numbers
From: Norbert Preining @ 2009-10-18 15:20 UTC (permalink / raw)
  To: Johan Herland; +Cc: git
In-Reply-To: <200910181703.20607.johan@herland.net>

On So, 18 Okt 2009, Johan Herland wrote:
> A global, increasing version number ala SVN is fundamentally impossible in 
> any distributed version control system (like Git).

Yes, agreed. 

The point is that I do not actually need the "distributed" part of git.
I want one central repository and all collaborators commit to that.
Yes, that is subversion, I know.

We have no branches, no tags, nothing of that. Only trunk.

>     $ git describe
>     v1.0.4-14-g2414721
> 
> where the "v1.0.4" part is the last tag that the current state is based on, 
> the "14" part is the number of commit between that tag and the current 

So if we have only one tag (initial) then it would count the number
of commits?

And if yes, is it easy to find out at which commit a file has been changed
last time (svn status -v).

I have read a lot on the net about the impossibility, and I agree that
in a distributed setting it does not work.

And in fact we would not even have revision numbers on our local
git repositories. Only one (the master checkout from which our 
distribution server is updated) needs to have some commit numbers.

THe reason is that we use that as serial number for packages. One packages
is roughly on package from CTAN (Comprehensive TeX Archive Network, 
like CPAN), and we want to make sure that if that is updated on CTAN
and we import it into our system, the next time we create a TeX Live
package for it (that will be served to quite a lot of users) we have
a new version number.

We first thought about using the version number as provided by authors,
but that is completely useless, because there are tooo many authors
of packages on CTAN where the version numbers are in no way increasing ;-)
So we settled for the max of all the last changed revision number of
the contained files, whcih is guaranteed to increase.

As a lat resort I will try to use git-svn ...

Again, thanks a lot and all the best

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining                                        Associate Professor
JAIST Japan Advanced Institute of Science and Technology   preining@jaist.ac.jp
Vienna University of Technology                               preining@logic.at
Debian Developer (Debian TeX Task Force)                    preining@debian.org
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
QUOYNESS (n.)
The hatefulness of words like 'relionus' and 'easiephit'.
			--- Douglas Adams, The Meaning of Liff

^ permalink raw reply

* Re: Creating something like increasing revision numbers
From: alexandrul @ 2009-10-18 15:29 UTC (permalink / raw)
  To: Norbert Preining; +Cc: git
In-Reply-To: <20091018144158.GA9789@gandalf.dynalias.org>

Norbert Preining wrote:
> My idea is that git - like subversion - could (if asked to) count each
> commit (global to the repository, irrelevant of the branch) and give it
> a version number. Since we all will use a bare repository on a server
> and pull/push from/to there, I think that something similar could be possible.

I was thinking to set a post-commit hook that reads the current version
from a file, increment and save it, and also set a tag with that value.

Being a DVCS, this kind of versioning can only be trusted on a single repo,
but if you set it on the "main" repo, it should work.

The only drawback could be the ever growing number of tags,
I don't know how it will work with thousands of tags or more.

Have a nice day,
  A.

^ permalink raw reply

* Re: Creating something like increasing revision numbers
From: Jon Smirl @ 2009-10-18 15:37 UTC (permalink / raw)
  To: Norbert Preining; +Cc: git
In-Reply-To: <20091018144158.GA9789@gandalf.dynalias.org>

On Sun, Oct 18, 2009 at 10:41 AM, Norbert Preining <preining@logic.at> wrote:
> Dear all,
>
> (please Cc)
>
> I am managing some of my projects with git and I am quite happy about it.
>
> There is another project I am working that is quite big, the subversion
> checkout is about 14Gb. Doing svn up is a pain, it has to open tens of
> thousands of files and directories traversing the whole tree, trashing
> the fs cache and taking ages.
>
> My idea was to move to git, from what I read it should be more capable
> in handling these type of projects.
>
> Now, there is one show-stopper I see. From our repository we create a
> set of "packages", and the maximum of the "last-changed" revisions of
> the contained files determine the "version" of the package. This
> guarantees that any change in a file will increase the revision number
> of the package (some tricks for removals have to be done). This is necessary
> since we are distributing the packages from servers and the version number
> pf a package determines whether it should be upgraded (well known concept).
>
> Now my question, is there any way to set up something similar with git?
>
> My idea is that git - like subversion - could (if asked to) count each
> commit (global to the repository, irrelevant of the branch) and give it
> a version number. Since we all will use a bare repository on a server
> and pull/push from/to there, I think that something similar could be possible.

There is a large LKML thread discussing this....
http://lwn.net/Articles/355923/

>
> So, before I delve into more gitty-nitty conversion, let me know if
> there is any chance for that, or we should stay with subversion.
>
> Thanks a lot and all the best
>
> Norbert
>
> PS: for those interested, it is TeX Live: www.tug.org/texlive
>
> -------------------------------------------------------------------------------
> Dr. Norbert Preining                                        Associate Professor
> JAIST Japan Advanced Institute of Science and Technology   preining@jaist.ac.jp
> Vienna University of Technology                               preining@logic.at
> Debian Developer (Debian TeX Task Force)                    preining@debian.org
> gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
> -------------------------------------------------------------------------------
> YONKERS (n.)
> (Rare.) The combined thrill of pain and shame when being caught in
> public plucking your nostril-hairs and stuffing them into your
> side-pocket.
>                        --- Douglas Adams, The Meaning of Liff
> --
> 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
>



-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply

* Re: Creating something like increasing revision numbers
From: demerphq @ 2009-10-18 15:37 UTC (permalink / raw)
  To: alexandrul; +Cc: Norbert Preining, git
In-Reply-To: <4ADB3452.6030508@gmail.com>

2009/10/18 alexandrul <alexandrul.ct@gmail.com>:
> Norbert Preining wrote:
>> My idea is that git - like subversion - could (if asked to) count each
>> commit (global to the repository, irrelevant of the branch) and give it
>> a version number. Since we all will use a bare repository on a server
>> and pull/push from/to there, I think that something similar could be possible.
>
> I was thinking to set a post-commit hook that reads the current version
> from a file, increment and save it, and also set a tag with that value.
>
> Being a DVCS, this kind of versioning can only be trusted on a single repo,
> but if you set it on the "main" repo, it should work.
>
> The only drawback could be the ever growing number of tags,
> I don't know how it will work with thousands of tags or more.

I think the other drawback is that the number would essentially be
meaningless and more or less would just be a substitute sha1.

Consider when a remote adds commits and then merges and pushes. What
number should those commits have?

Yves



-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

^ permalink raw reply

* Re: Creating something like increasing revision numbers
From: Norbert Preining @ 2009-10-18 15:45 UTC (permalink / raw)
  To: demerphq; +Cc: alexandrul, git
In-Reply-To: <9b18b3110910180837h18e15f74g74626847b6ce4da3@mail.gmail.com>

On So, 18 Okt 2009, demerphq wrote:
> > Being a DVCS, this kind of versioning can only be trusted on a single repo,
> > but if you set it on the "main" repo, it should work.
> >
> > The only drawback could be the ever growing number of tags,
> > I don't know how it will work with thousands of tags or more.
> 
> I think the other drawback is that the number would essentially be
> meaningless and more or less would just be a substitute sha1.

Well, it would be increasing for that repository. And if we always
update our packages from that repository the packages will be guaranteed
to have increasing version number, too.

That is the *only* thing I care about. The numbers don't need to have
a meaning, nothing else but that in our workflow we guarantee
that at the end each package progresses in version numbers.

> Consider when a remote adds commits and then merges and pushes. What
> number should those commits have?

When using a central repository to which he pushes within that central
repository it would give a specific number.

Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining                                        Associate Professor
JAIST Japan Advanced Institute of Science and Technology   preining@jaist.ac.jp
Vienna University of Technology                               preining@logic.at
Debian Developer (Debian TeX Task Force)                    preining@debian.org
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
WIMBLEDON (n.)
That last drop which, no matter how much you shake it, always goes
down your trouser leg.
			--- Douglas Adams, The Meaning of Liff

^ permalink raw reply

* Re: Creating something like increasing revision numbers
From: demerphq @ 2009-10-18 16:16 UTC (permalink / raw)
  To: Norbert Preining; +Cc: alexandrul, git
In-Reply-To: <20091018154528.GA5688@gamma.logic.tuwien.ac.at>

2009/10/18 Norbert Preining <preining@logic.at>:
> On So, 18 Okt 2009, demerphq wrote:
>> > Being a DVCS, this kind of versioning can only be trusted on a single repo,
>> > but if you set it on the "main" repo, it should work.
>> >
>> > The only drawback could be the ever growing number of tags,
>> > I don't know how it will work with thousands of tags or more.
>>
>> I think the other drawback is that the number would essentially be
>> meaningless and more or less would just be a substitute sha1.
>
> Well, it would be increasing for that repository. And if we always
> update our packages from that repository the packages will be guaranteed
> to have increasing version number, too.
>
> That is the *only* thing I care about. The numbers don't need to have
> a meaning, nothing else but that in our workflow we guarantee
> that at the end each package progresses in version numbers.
>
>> Consider when a remote adds commits and then merges and pushes. What
>> number should those commits have?
>
> When using a central repository to which he pushes within that central
> repository it would give a specific number.

Consider you have A-B-C-D-E in your master repo. So presumably numbered 1..5.

If i then make a trivial comment fix to A and then merge and push we
end up with:

A-B-C-D-E-G
 \        /
  F------+

If i understand you right you will set F to 6 and G to 7. Thus youll
end up with the problem that F is a descendent of A yet has a higher
"version number" than E. You can repeat this process for ever.

If this suits your needs then great.

cheers,
Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

^ permalink raw reply

* Re: Creating something like increasing revision numbers
From: alexandrul @ 2009-10-18 16:35 UTC (permalink / raw)
  To: demerphq; +Cc: Norbert Preining, git
In-Reply-To: <9b18b3110910180916s2a2ac751i7520e64294037817@mail.gmail.com>

demerphq wrote:
> Consider you have A-B-C-D-E in your master repo. So presumably numbered 1..5.
> 
> If i then make a trivial comment fix to A and then merge and push we
> end up with:
> 
> A-B-C-D-E-G
>  \        /
>   F------+
> 
> If i understand you right you will set F to 6 and G to 7. Thus youll
> end up with the problem that F is a descendent of A yet has a higher
> "version number" than E. You can repeat this process for ever.
> 
> If this suits your needs then great.

Just like subversion :D

It helps by ordering commits by time, not by parents, and I don't need
repo access to figure it out that F is the latest bug/feature/fix.

Think about 2 sql servers, each has different versions of the same
stored procedure. Which one is newer, given that you don't have
the git repository on the production servers? I can't make any decision
on SHA1 only, and if they belong to the same branch ("prod")
I'm so out of luck. At the moment I'm saving SHA1, refs, author date,
comitter date and last subject. But it's easier for me to compare
revision numbers than dates. And don't forget that updating decisions
may be taken by people that have nothing to do with development.

Have a nice day,
  A.

^ permalink raw reply

* Re: [ANNOUNCE] GIT 1.6.5
From: Sebastian Pipping @ 2009-10-18 17:05 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7v8wfi1fya.fsf@alter.siamese.dyndns.org>

Junio C Hamano wrote:
>  * "git push" can be told to be --quiet.

If I'm not mistaken --quiet is not documented in the git-push man page.
This includes release 1.6.5.1.



Sebastian

^ 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