Git development
 help / color / mirror / Atom feed
* Re: [PATCH] Documentation: suggest "reset --keep" to undo a commit
From: Junio C Hamano @ 2011-01-21 17:34 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Johannes Schindelin, Thomas Rast, Nicolas Sebrecht, Matthieu Moy,
	git, Kevin Ballard, Yann Dirson, Eric Raible, Christian Couder
In-Reply-To: <20110121073730.GA26276@burratino>

Jonathan Nieder <jrnieder@gmail.com> writes:

> When one's only goal is to move from one commit to another, reset
> --keep is simply better than reset --hard, since it preserves local
> changes in the index and worktree when easy and errors out without
> doing anything when not.  Update the two "how to remove commits"
> examples in this vein.  "reset --hard" is still explained in a later
> example about cleaning up during a merge.

I agree with the first sentence but I do not think its conclusion would
lead to changes to "how to _remove_ commits".  The examples were written
in contexts (explanatory text <$n>) where hard makes sense, and the
context needs tweaking to make keep makes more sense than hard does.

For example, the first one's original sequence is this:

    $ git branch topic/wip
    $ git reset --hard HEAD~3
    $ git checkout topic/wip

The text explains the motivation behind these series of commands in <1>
but it has one untold assumption behind it; the user did the review to
reach the conclusion that the recent changes are premature after fully
committing (i.e. the working tree is clean).  That is why "hard" worked
just fine.

But the user could do the reviewing and thinking with some local changes
still in the working tree (they are incredients for the fourth commit yet
to be made) and decide to branch at that point.  The description in <1>
needs to be updated to hint that there can be uncommitted changes, e.g.

	You have worked for some time, made a few commits, and may have
	uncommitted changes.  After reviewing the current state, you
	realized that ...

Using --keep may help the user do so, but only if the local changes do not
conflict with the changes in the recent commits to be discarded, right?

    Side note: Regardless of any of the above, the section header needs to
    be updated---it is not "Undo *A* commit", we are excluding three from
    the current branch.

By the way, a more natural way to do this would actually be:

    $ git checkout -b topic/wip
    $ git branch -f @{-1} HEAD~3

or using the stash:

    $ git stash ;# save local changes
    $ git branch topic/wip ;# and mark the tip before rewinding
    $ git reset --hard HEAD~3 ;# you could say --keep here too
    $ git checkout topic/wip ;# and then continue
    $ git stash pop ;# with the local changes

The branch/reset/checkout sequence itself, either with hard or keep, looks
more like a contrived example to show "reset" than the best way to solve
the problem in the scenario presented there.  Probably we would want to
drop this one altogether, or keep the scenario and explain the best
solution in somewhere else (e.g. tutorial).

> @@ -163,7 +163,7 @@ Undo commits permanently::
>  +
>  ------------
>  $ git commit ...
> -$ git reset --hard HEAD~3   <1>
> +$ git reset --keep HEAD~3   <1>
>  ------------
>  +
>  <1> The last three commits (HEAD, HEAD^, and HEAD~2) were bad

Please tell a story where keep makes more sense than hard by enhancing the
explanatory text <1> associated with this section.  The current text says
that the three topmost commit representing what you have recently worked
so far are all unwanted, strongly hinting that hard is more appropriate
thing to do than keep, which is not what we want if we are changing the
example to use keep.

It would be sufficient to just hint that the uncommitted changes that you
have in your working tree are unrelated to what these three commits wanted
to do (e.g. you always keep small changes around, such as debugging
printf's and a change to the version string in Makefile---you do not
intend to commit them and they are unrelated to the commits you are
discarding), and you do want to keep them around if you can.

^ permalink raw reply

* Re: [PATCH 2/2] Re: rebase -i: explain how to discard all commits
From: Matthieu Moy @ 2011-01-21 17:05 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Johannes Schindelin, Thomas Rast, Nicolas Sebrecht,
	Jonathan Nieder, git, Kevin Ballard, Yann Dirson, Eric Raible
In-Reply-To: <7vsjwmp5cs.fsf@alter.siamese.dyndns.org>

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

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>>> Wouldn't that suggest us that if we were to do anything to this message 
>>> it would be a good idea to teach the user to "reset --hard" the branch 
>>> if no commits truly needs to be replayed on top of the onto-commit?
>>
>> The important difference between rebase -i && noop on the one, and reset 
>> --hard on the other hand is that the latter is completely unsafe. I mean, 
>> utterly completely super-unsafe. And I say that because _this here 
>> developer_ who is not exactly a Git noob lost stuff that way.
>
> I think "rebase" already checks that the index and the working tree is
> clean before starting, so referring to "reset --hard" when "rebase -i"
> notices there is absolutely nothing to do is _not_ unsafe, no?

The point is not about letting rebase do a "reset --hard", but to tell
the user s/he should have ran "reset --hard" instead of rebase. The
danger is to teach the user's fingers to type "reset --hard" too
often, which is unsafe ;-).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply

* Psifiste tora poios Prothypourgos euthynetai perissotero gia tin simerini tragiki katastasi tis Oikonomias
From: To site ton ROMION   www.romioi.com @ 2011-01-21 14:48 UTC (permalink / raw)


Agapitoi Filoi,

Psifiste tora poios Prothypourgos euthynetai perissotero
gia tin simerini tragiki katastasi tis Oikonomias:
http://www.romioi.com/2011/01/blog-post_8804.html

kai akoma an thelete (proairetika) grapste eleuthera
tin apopsi sas edo
http://www.romioi.com/2011/01/blog-post_8804.html

OLA TA SCHOLIA DIMOSIEVONTAI AMESOS, CHORIS KATHYSTERISI
kai CHORIS LOGOKRISIA

Paratirisi: Grafoume me Greeklish gia na to diavazete oloi. 
http://www.romioi.com  

EPISKEPSIMOTITA! Chtes kai mono chtes: 3000 atoma episkeftikan tin selida mas:
      www.romioi.com

	  
	 * Giati "Romioi"?
	  Diavase to http://en.wikipedia.org/wiki/Names_of_the_Greeks

	  
------------------------------------------------------------------------
PROSOCHI: Ean thelete na min xanalavete email ,tote  steilte ena email sto
sfakaonline@gmail.com 
me thema (Subject): AFAIRESE email1, email2, email3,...
opou email1, email2, email3,... einai ta email sas
p.h.
AFAIRESE romioi@gmail.com, romioi@mail.gr

I diadikasia einai automati. I lexi AFAIRESE prepei na graftei me latinika
kai me kefalaia opos einai sto paradeigma
------------------------------------------------------------------------

^ permalink raw reply

* Re: [PATCH 2/2] Re: rebase -i: explain how to discard all commits
From: Junio C Hamano @ 2011-01-21 16:51 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Thomas Rast, Nicolas Sebrecht, Jonathan Nieder, Matthieu Moy, git,
	Kevin Ballard, Yann Dirson, Eric Raible
In-Reply-To: <alpine.DEB.1.00.1101210801210.15247@pacific.mpi-cbg.de>

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

>> Wouldn't that suggest us that if we were to do anything to this message 
>> it would be a good idea to teach the user to "reset --hard" the branch 
>> if no commits truly needs to be replayed on top of the onto-commit?
>
> The important difference between rebase -i && noop on the one, and reset 
> --hard on the other hand is that the latter is completely unsafe. I mean, 
> utterly completely super-unsafe. And I say that because _this here 
> developer_ who is not exactly a Git noob lost stuff that way.

I think "rebase" already checks that the index and the working tree is
clean before starting, so referring to "reset --hard" when "rebase -i"
notices there is absolutely nothing to do is _not_ unsafe, no?

^ permalink raw reply

* Re: [PATCH v2] Documentation fixes in git-config
From: Jeff King @ 2011-01-21 16:25 UTC (permalink / raw)
  To: Libor Pechacek; +Cc: git
In-Reply-To: <20110121102537.GH19715@fm.suse.cz>

On Fri, Jan 21, 2011 at 11:25:37AM +0100, Libor Pechacek wrote:

> Variable names must start with an alphabetic character, regexp config key
> matching has its limits.

I think this is fine, although:

>  --get-regexp::
> -	Like --get-all, but interprets the name as a regular expression.
> -	Also outputs the key names.
> +	Like --get-all, but interprets the name as a regular expression and
> +	writes out the key names.  Regular expression matching is currently
> +	case-sensitive and done against a canonicalized version of the key
> +	in which section and variable names are lowercased, but subsection
> +	names are not.  Regular expressions are partially lower-cased
> +	before matching (everything before the first dot and after the last
> +	dot), which makes things like "Core.*' work.

I am half-tempted to mark the lowercasing of the regex as deprecated (or
at least discouraged). It's such a hack, and I don't think we will ever
improve to make it work in the general case, as regexes are simply too
complex for us to handle all possible inputs.

Either way, though, this is definitely an improvement over what is
there, so:

Acked-by: Jeff King <peff@peff.net>

-Peff

^ permalink raw reply

* Re: [PATCH v2] Sanity-ckeck config variable names
From: Jeff King @ 2011-01-21 16:23 UTC (permalink / raw)
  To: Libor Pechacek; +Cc: git
In-Reply-To: <20110121102339.GG19715@fm.suse.cz>

On Fri, Jan 21, 2011 at 11:23:39AM +0100, Libor Pechacek wrote:

> Sanity-ckeck config variable names when adding and retrieving them.  As a side

Typo: s/ckeck/check/

Other than that, this version looks good to me.

Acked-by: Jeff King <peff@peff.net>

-Peff

^ permalink raw reply

* Re: Parameter --color-words not documented for "git show"
From: Jeff King @ 2011-01-21 16:17 UTC (permalink / raw)
  To: Maaartin
  Cc: Nicolas Sebrecht, Junio C Hamano, Sebastian Pipping, Thomas Rast,
	Git ML
In-Reply-To: <4D395B15.2040406@seznam.cz>

On Fri, Jan 21, 2011 at 11:08:21AM +0100, Maaartin wrote:

> Maybe there could be sort-of extended manpage, containing everything,
> but it would need some markup beyond the capabilities of a terminal (a
> grayed or collapsed area in html, or whatever). However, this could be a
> lot of additional work, and I don't claim it should be done, just an idea.

Yeah, that would be nice, but it is beyond the manpage format. For HTML
versions, we can (and will) hyperlink, which at least makes following
the reference easy to do.

-Peff

^ permalink raw reply

* Re: Parameter --color-words not documented for "git show"
From: Jeff King @ 2011-01-21 16:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Nicolas Sebrecht, Sebastian Pipping, Thomas Rast, Git ML
In-Reply-To: <7vy66epz4r.fsf@alter.siamese.dyndns.org>

On Thu, Jan 20, 2011 at 10:08:36PM -0800, Junio C Hamano wrote:

> >   3. Say "we also take diff options, and you can find out more about
> >      diff options in git-diff(1)." This at least points the user in the
> >      right direction, but you can't search for "--color-words" in the
> >      page.
> >
> >   4. Do (3), but also list the all (or common) diff options in a succint
> >      list without descriptions, and refer the user to git-diff(1). Then
> >      they can grep if they like, and while they won't get the immediate
> >      answer, they will get referred to the right place.
> [...]
> One complication in either 3 or 4 is that they sometimes need to be
> accompanied with "... except these diff options do not make sense in the
> context of this command, so they are no-op".  That is probably a price
> worth paying to be more helpful than 2 is.

Yeah, I took a quick look at diff-options.txt. I think many of those
special cases can be handled by just mentioning the exceptions in the
text. They are usually simple and obvious special cases, like "for -M,
if you are in a command which is traversing, you might be interested in
--follow". I don't think it will hurt people to read that, even if they
are looking at the diff-options because they want to know about "git
diff".

I'll this to my documentation cleanup todo list. It's lower priority
than many other things, but believe it or not I am working towards it.
:)

-Peff

^ permalink raw reply

* Re: cannot fetch arm git tree
From: Uwe Kleine-König @ 2011-01-21 15:25 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Detlef Vollmann, Jello huang, git, linux-arm-kernel
In-Reply-To: <20110121145025.GS13235@n2100.arm.linux.org.uk>

On Fri, Jan 21, 2011 at 02:50:26PM +0000, Russell King - ARM Linux wrote:
> On Fri, Jan 21, 2011 at 03:28:14PM +0100, Detlef Vollmann wrote:
> > It seems to be an implementation of the git protocol using
> > HTTP as transport.
> > Some info on this is at <http://progit.org/2010/03/04/smart-http.html>.
> 
> Setting up Smart HTTP
> 
> ...
>    To set it up, it■s best to walk through the instructions on the
>    `git-http-backend` documentation page. Basically, you have to install Git
>    v1.6.6 or higher on a server with an Apache 2.x webserver (it has to be
>    Apache, currently - other CGI servers don■t work, last I checked). Then
>    you add something similar to this to your http.conf file:
> 
>  SetEnv GIT_PROJECT_ROOT /var/www/git
>  SetEnv GIT_HTTP_EXPORT_ALL
>  ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
> 
> Great.  Deciding that it will be http://servername.example.com/git/ is
> really damned annoying as that's traditionally where gitweb lives,
> which requires a different script alias.
> 
> It seems that due to a lack of coordination between different git
> developers, people running webservers have a choice between providing
> gitweb or this http extension.
> 
> I'm really not interested in working out how to bodge this into working
> along side the existing gitweb setup by adding lots of rewrite rules, so
> as gitweb got there first I think it has priority, that's what we have
> and we'll have to live without the smart http extensions.
IIRC it's designed to live along side the http:// clone url.
git-http-backend can still serve dumb http clients including a web
browser.
 
But note that as git-http-backend less info it has to calculate much
more.  So the load it introduces should be comparable to running
git-daemon as should be the times to fetch from it.  So AFAIK the only
reason to run it is that more corporate users can access port 80.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply

* Re: cannot fetch arm git tree
From: Detlef Vollmann @ 2011-01-21 15:14 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-arm-kernel, Jello huang, git, Uwe Kleine-König
In-Reply-To: <20110121145025.GS13235@n2100.arm.linux.org.uk>

On 01/21/11 15:50, Russell King - ARM Linux wrote:
> On Fri, Jan 21, 2011 at 03:28:14PM +0100, Detlef Vollmann wrote:
>> It seems to be an implementation of the git protocol using
>> HTTP as transport.
>> Some info on this is at<http://progit.org/2010/03/04/smart-http.html>.
>
> Setting up Smart HTTP
>
> ...
>     To set it up, it■s best to walk through the instructions on the
>     `git-http-backend` documentation page. Basically, you have to install Git
>     v1.6.6 or higher on a server with an Apache 2.x webserver (it has to be
>     Apache, currently - other CGI servers don■t work, last I checked). Then
>     you add something similar to this to your http.conf file:
>
>   SetEnv GIT_PROJECT_ROOT /var/www/git
>   SetEnv GIT_HTTP_EXPORT_ALL
>   ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
>
> Great.  Deciding that it will be http://servername.example.com/git/ is
> really damned annoying as that's traditionally where gitweb lives,
> which requires a different script alias.
>
> It seems that due to a lack of coordination between different git
> developers, people running webservers have a choice between providing
> gitweb or this http extension.
Huh?
/git/ is just the example here, you can use any name you want.
E.g. I use /auth/ for authenticated users, and others use /gitmob/
or /gitanon/ for non-authenticated users.
And you can use something like gitsmart, githttp, or whatever...

   Detlef


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* Move git-stash from one machine (or working copy) to another
From: Patrick Doyle @ 2011-01-21 14:54 UTC (permalink / raw)
  To: git

Is there an easy way to move work in progress from one machine to another?

One way to do it might be something like this:

machine1$ git checkout -b movewip
machine1$ git add .
machine1$ git commit -m "Moving work in progress"
machine1$ git push origin movewip:movewip

machine2$ git fetch origin movewip:movewip:
machine2$ git checkout movewip
machine2$ git reset HEAD^
machine2$ git stash
machine2$ git checkout master
machine2$ git stash pop

# go through and delete movewip branches on machine1, machine2, and
the origin server

Except for some possible typos, this seems like it would work, but
seems to be awfully clumsy.  Is there a more elegant way to accomplish
this?

It seems to me that if I could git-stash on machine1, take that stash
with me (somehow) to machine2, and then pop it there, that would be
easier.
--wpd

^ permalink raw reply

* Re: cannot fetch arm git tree
From: Russell King - ARM Linux @ 2011-01-21 14:50 UTC (permalink / raw)
  To: Detlef Vollmann; +Cc: Uwe Kleine-König, Jello huang, git, linux-arm-kernel
In-Reply-To: <4D3997FE.5030109@vollmann.ch>

On Fri, Jan 21, 2011 at 03:28:14PM +0100, Detlef Vollmann wrote:
> It seems to be an implementation of the git protocol using
> HTTP as transport.
> Some info on this is at <http://progit.org/2010/03/04/smart-http.html>.

Setting up Smart HTTP

...
   To set it up, it■s best to walk through the instructions on the
   `git-http-backend` documentation page. Basically, you have to install Git
   v1.6.6 or higher on a server with an Apache 2.x webserver (it has to be
   Apache, currently - other CGI servers don■t work, last I checked). Then
   you add something similar to this to your http.conf file:

 SetEnv GIT_PROJECT_ROOT /var/www/git
 SetEnv GIT_HTTP_EXPORT_ALL
 ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/

Great.  Deciding that it will be http://servername.example.com/git/ is
really damned annoying as that's traditionally where gitweb lives,
which requires a different script alias.

It seems that due to a lack of coordination between different git
developers, people running webservers have a choice between providing
gitweb or this http extension.

I'm really not interested in working out how to bodge this into working
along side the existing gitweb setup by adding lots of rewrite rules, so
as gitweb got there first I think it has priority, that's what we have
and we'll have to live without the smart http extensions.

It's really not that big a deal if you follow the advice I've given.

^ permalink raw reply

* fast-import/export from Plastic SCM questions about renames
From: psantosl @ 2011-01-21 13:41 UTC (permalink / raw)
  To: git

Hi,

I'm currently developing a fast-export (and later a fast-import) to be
able to export from Plastic SCM to Git and also import from Git to
Plastic SCM.

Plastic tracks history of directories and hence it easy to handle moves
between directories. But, during the export/import from plastic to git I
found the following situation:

R src/samples/sampledata src/samples/samplebase
R src/samples/samplebase/Test.Workflow.xml
src/samples/samplebase/new/Test.Workflow.xml

It is a "move within" a move and it always fails telling that
src/samples/samplebase/Test.Workflow.xml is not in the branch.

If I split the "move" op into a delete + an add, it works, but reading
the documentation I expected it to work.

Also, after splitting the "moves" into add/delete pairs, I've found an
issue with a simple rename:

- a directory that is renamed from src/Diff to src/diff (here I kept a R
operation)

- 1000 commits later (after tons of files have been modified inside the
src/diff dir) I get a rename like src/diff/Diff.c src/diff/diff.cs and
an error saying src/diff/Diff.c is not in the branch.

It is very possible that my export code is wrong, but I wanted to check
if it is better to simply get rid of the "move" (R) operations in
fast-export.

Thanks,

pablo


www.plasticscm.com

^ permalink raw reply

* Re: cannot fetch arm git tree
From: Detlef Vollmann @ 2011-01-21 14:28 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-arm-kernel, Jello huang, git, Uwe Kleine-König
In-Reply-To: <20110121135725.GR13235@n2100.arm.linux.org.uk>

On 01/21/11 14:57, Russell King - ARM Linux wrote:
> On Fri, Jan 21, 2011 at 02:47:28PM +0100, Uwe Kleine-König wrote:
>> Hi Detlef,
>>
>> On Fri, Jan 21, 2011 at 02:38:11PM +0100, Detlef Vollmann wrote:
>>> On 01/16/11 14:42, Russell King - ARM Linux wrote:
>>>> Let's say you already have a copy of my tree from a month ago, and Linus
>>>> has pulled some work from me into his tree, and repacked his tree into one
>>>> single pack file.  At the moment, the largest pack file from Linus is
>>>> 400MB plus a 50MB index.
>>>>
>>>> You already have most of the contents of that 400MB pack file, but if
>>>> you're missing even _one_ object which is contained within it, git will
>>>> have to download the _entire_ 400MB pack file and index file to retrieve
>>>> it.
>>> I thought this has changed with "smart http" in git 1.6.6.
>>> Am I missing something?
>> Well, not all http repos offer smart http.  E.g. Russell doesn't[1],
>> probably because the serving machine doesn't have the power to nice
>> serve a repo via git:// or smart http://.
>
> What is smart http?  I don't particularly follow git developments.
It seems to be an implementation of the git protocol using
HTTP as transport.
Some info on this is at <http://progit.org/2010/03/04/smart-http.html>.

   Detlef

^ permalink raw reply

* Re: cannot fetch arm git tree
From: Russell King - ARM Linux @ 2011-01-21 13:57 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Detlef Vollmann, Jello huang, git, linux-arm-kernel
In-Reply-To: <20110121134728.GO14956@pengutronix.de>

On Fri, Jan 21, 2011 at 02:47:28PM +0100, Uwe Kleine-König wrote:
> Hi Detlef,
> 
> On Fri, Jan 21, 2011 at 02:38:11PM +0100, Detlef Vollmann wrote:
> > On 01/16/11 14:42, Russell King - ARM Linux wrote:
> > >Let's say you already have a copy of my tree from a month ago, and Linus
> > >has pulled some work from me into his tree, and repacked his tree into one
> > >single pack file.  At the moment, the largest pack file from Linus is
> > >400MB plus a 50MB index.
> > >
> > >You already have most of the contents of that 400MB pack file, but if
> > >you're missing even _one_ object which is contained within it, git will
> > >have to download the _entire_ 400MB pack file and index file to retrieve
> > >it.
> > I thought this has changed with "smart http" in git 1.6.6.
> > Am I missing something?
> Well, not all http repos offer smart http.  E.g. Russell doesn't[1],
> probably because the serving machine doesn't have the power to nice
> serve a repo via git:// or smart http://.

What is smart http?  I don't particularly follow git developments.

^ permalink raw reply

* Re: cannot fetch arm git tree
From: Uwe Kleine-König @ 2011-01-21 13:47 UTC (permalink / raw)
  To: Detlef Vollmann
  Cc: Russell King - ARM Linux, Jello huang, git, linux-arm-kernel
In-Reply-To: <4D398C43.1000306@vollmann.ch>

Hi Detlef,

On Fri, Jan 21, 2011 at 02:38:11PM +0100, Detlef Vollmann wrote:
> On 01/16/11 14:42, Russell King - ARM Linux wrote:
> >Let's say you already have a copy of my tree from a month ago, and Linus
> >has pulled some work from me into his tree, and repacked his tree into one
> >single pack file.  At the moment, the largest pack file from Linus is
> >400MB plus a 50MB index.
> >
> >You already have most of the contents of that 400MB pack file, but if
> >you're missing even _one_ object which is contained within it, git will
> >have to download the _entire_ 400MB pack file and index file to retrieve
> >it.
> I thought this has changed with "smart http" in git 1.6.6.
> Am I missing something?
Well, not all http repos offer smart http.  E.g. Russell doesn't[1],
probably because the serving machine doesn't have the power to nice
serve a repo via git:// or smart http://.

Best regards
Uwe

[1] I didn't recheck though

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply

* Re: cannot fetch arm git tree
From: Detlef Vollmann @ 2011-01-21 13:38 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-arm-kernel, Jello huang, git, Uwe Kleine-König
In-Reply-To: <20110116134248.GD27542@n2100.arm.linux.org.uk>

On 01/16/11 14:42, Russell King - ARM Linux wrote:
> Let's say you already have a copy of my tree from a month ago, and Linus
> has pulled some work from me into his tree, and repacked his tree into one
> single pack file.  At the moment, the largest pack file from Linus is
> 400MB plus a 50MB index.
>
> You already have most of the contents of that 400MB pack file, but if
> you're missing even _one_ object which is contained within it, git will
> have to download the _entire_ 400MB pack file and index file to retrieve
> it.
I thought this has changed with "smart http" in git 1.6.6.
Am I missing something?

   Detlef

^ permalink raw reply

* Re: git bisect problems/ideas
From: Christian Couder @ 2011-01-21 13:18 UTC (permalink / raw)
  To: Aaron S. Meurer; +Cc: git, SZEDER Gábor, Jonathan Nieder
In-Reply-To: <0253BAE3-90F7-492C-ADF5-8B16DFFA1E44@gmail.com>

On Wed, Jan 19, 2011 at 8:44 PM, Aaron S. Meurer <asmeurer@gmail.com> wrote:
>>>
>>> I don't understand how this can only be one way?  Isn't this symmetric?  In
>>> other words, how is it different from
>>>
>>> A-B-C-D-E <-- dev
>>>    \F-G <-- master
>>>
>>> as far as bisect is concerned? Or maybe I am not entirely clear on what you
>>> are saying.
>>
>> Yes, it is symmetric, so we cannot just automatically reverse the
>> meanning because there is no "after" or "before" relationship between
>> "dev" and "master".
>
> I think I understand.  What if something works in A, gets broken in C, stays broken in E, but gets fixed in G?  Should it maybe be implied by whichever one is marked as good first, A or G, if you trying to find the fix or the break?

In this case, if we are given "git bisect bad E" and "git bisect good
A", yes, as A is before E, we must suppose that we are looking for the
break.

But if we are given "git bisect bad E" and "git bisect good G", we
have to suppose that we are looking for the break too. There are many
good reasons for that:

- it's the logical default for bisect,
- if what is wanted is the fix, there has been for a long time the
possibility to just switch "bad" and "good",
- the user might not even realize that E and G have no "after" or
"before" relationship.

> If no, I think --reverse is actually a suitable fix.

Yeah, but I think that what Dscho started was probably better. The
problem is just that it is not so simple to implement and no one yet
has been interested enough or took enough time to finish it.

Best regards,
Christian.

^ permalink raw reply

* [PATCH] git-gui: add config value gui.diffopts for passing additional diff options
From: Tilman Vogel @ 2011-01-21 10:59 UTC (permalink / raw)
  To: git; +Cc: Tilman Vogel

Signed-off-by: Tilman Vogel <tilman.vogel@web.de>
---
 Documentation/config.txt |    4 ++++
 git-gui/git-gui.sh       |    1 +
 git-gui/lib/diff.tcl     |    1 +
 git-gui/lib/option.tcl   |    1 +
 4 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index ff7c225..0ed7bcf 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1100,6 +1100,10 @@ gui.diffcontext::
 	Specifies how many context lines should be used in calls to diff
 	made by the linkgit:git-gui[1]. The default is "5".
 
+gui.diffopts::
+	Specifies additional parameters to pass to diff from 
+	linkgit:git-gui[1]. The default is "".
+
 gui.encoding::
 	Specifies the default encoding to use for displaying of
 	file contents in linkgit:git-gui[1] and linkgit:gitk[1].
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index d3acf0d..2a3aed5 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -823,6 +823,7 @@ set default_config(gui.fastcopyblame) false
 set default_config(gui.copyblamethreshold) 40
 set default_config(gui.blamehistoryctx) 7
 set default_config(gui.diffcontext) 5
+set default_config(gui.diffopts) {}
 set default_config(gui.commitmsgwidth) 75
 set default_config(gui.newbranchtemplate) {}
 set default_config(gui.spellingdictionary) {}
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl
index dcf0711..de3827a 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -295,6 +295,7 @@ proc start_show_diff {cont_info {add_opts {}}} {
 
 	lappend cmd -p
 	lappend cmd --color
+	set cmd [concat $cmd $repo_config(gui.diffopts)]
 	if {$repo_config(gui.diffcontext) >= 1} {
 		lappend cmd "-U$repo_config(gui.diffcontext)"
 	}
diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl
index 3807c8d..1e5d28c 100644
--- a/git-gui/lib/option.tcl
+++ b/git-gui/lib/option.tcl
@@ -153,6 +153,7 @@ proc do_options {} {
 		{i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
 		{i-0..300 gui.blamehistoryctx {mc "Blame History Context Radius (days)"}}
 		{i-1..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
+		{t gui.diffopts {mc "Additional Diff Parameters"}}
 		{i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
 		{t gui.newbranchtemplate {mc "New Branch Name Template"}}
 		{c gui.encoding {mc "Default File Contents Encoding"}}
-- 
1.7.3.4

^ permalink raw reply related

* Xekleidothikan ta scholia . Archise i dimosia sizitisi,  http://www.romioi.com
From: To site ton ROMION   www.romioi.com @ 2011-01-20 13:04 UTC (permalink / raw)


Filoi mou kaloi!

Archise i dimosia sizitisi http://www.romioi.com

Ola ta scholia xekleidothikan kai mporeite na anevazete ta scholia
sas choris kamia logokrisia sto  http://www.romioi.com

Neo sima kai neos Ymnos tis Neas Dimokratias
http://www.romioi.com

Polla scholia pairnoun:
1) to giati o Kyrios Adrianopoulos torpillizei tin Ethniki Prospatheia diasosis tis
Oikonomias
http://www.romioi.com/2011/01/blog-post_424.html

2) oi KOPRITES tou ... Pagkalou
http://www.romioi.com/2011/01/wwwromioicom_18.html

3) kai akoma  
Mpes tora kai anevase AMESOS to scholio sou
Scholiaste akoma
to Post apo to KENTRI "Choris Praktiki axia oi allages sto Nomo peri euthynis
Ypourgon"
http://www.romioi.com
----------------------------------------------
PROSOCHI: Ean thelete na min xanalavete email ,tote  steilte ena email sto
sfakaonline@gmail.com 
me thema (Subject): AFAIRESE email1, email2, email3,...
opou email1, email2, email3,... einai ta email sas
p.h.
AFAIRESE romioi@gmail.com, romioi@mail.gr

I diadikasia einai automati. I lexi AFAIRESE prepei na graftei me latinika
kai me kefalaia opos einai sto paradeigma
-----------------------------------------------

^ permalink raw reply

* Re: [PATCH 1/2 v2] rebase -i: clarify in-editor documentation of "exec"
From: Matthieu Moy @ 2011-01-21 10:43 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: Junio C Hamano, git, Kevin Ballard, Yann Dirson, Eric Raible
In-Reply-To: <20110121074700.GA26600@burratino>

Jonathan Nieder <jrnieder@gmail.com> writes:

> # Commands:
> #  p, pick = use commit
> #  r, reword = use commit, but edit the commit message
> #  e, edit = use commit, but stop for amending
> #  s, squash = use commit, but meld into previous commit
> #  f, fixup = like "squash", but discard this commit's log message
> #  x, exec = run command (the rest of the line) using shell

I'm fine with that.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply

* [PATCH v2] Documentation fixes in git-config
From: Libor Pechacek @ 2011-01-21 10:25 UTC (permalink / raw)
  To: git; +Cc: Jeff King
In-Reply-To: <20110121102048.GF19715@fm.suse.cz>

Variable names must start with an alphabetic character, regexp config key
matching has its limits.

Signed-off-by: Libor Pechacek <lpechacek@suse.cz>
Cc: Jeff King <peff@peff.net>
---
 Documentation/config.txt     |   12 +++++++-----
 Documentation/git-config.txt |    9 +++++++--
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index ff7c225..928ceda 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -12,8 +12,9 @@ The configuration variables are used by both the git plumbing
 and the porcelains. The variables are divided into sections, wherein
 the fully qualified variable name of the variable itself is the last
 dot-separated segment and the section name is everything before the last
-dot. The variable names are case-insensitive and only alphanumeric
-characters are allowed. Some variables may appear multiple times.
+dot. The variable names are case-insensitive, allow only alphanumeric
+characters and '-', and must start with an alphabetic character.  Some
+variables may appear multiple times.
 
 Syntax
 ~~~~~~
@@ -53,9 +54,10 @@ All the other lines (and the remainder of the line after the section
 header) are recognized as setting variables, in the form
 'name = value'.  If there is no equal sign on the line, the entire line
 is taken as 'name' and the variable is recognized as boolean "true".
-The variable names are case-insensitive and only alphanumeric
-characters and `-` are allowed.  There can be more than one value
-for a given variable; we say then that variable is multivalued.
+The variable names are case-insensitive, allow only alphanumeric characters
+and `-`, and must start with an alphabetic character.  There can be more
+than one value for a given variable; we say then that variable is
+multivalued.
 
 Leading and trailing whitespace in a variable value is discarded.
 Internal whitespace within a variable value is retained verbatim.
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 543dd64..31f4658 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -83,8 +83,13 @@ OPTIONS
 	is not exactly one.
 
 --get-regexp::
-	Like --get-all, but interprets the name as a regular expression.
-	Also outputs the key names.
+	Like --get-all, but interprets the name as a regular expression and
+	writes out the key names.  Regular expression matching is currently
+	case-sensitive and done against a canonicalized version of the key
+	in which section and variable names are lowercased, but subsection
+	names are not.  Regular expressions are partially lower-cased
+	before matching (everything before the first dot and after the last
+	dot), which makes things like "Core.*' work.
 
 --global::
 	For writing options: write to global ~/.gitconfig file rather than
-- 
1.7.4.rc2.20.gdb1b81

^ permalink raw reply related

* [PATCH v2] Sanity-ckeck config variable names
From: Libor Pechacek @ 2011-01-21 10:23 UTC (permalink / raw)
  To: git; +Cc: Jeff King
In-Reply-To: <20110121100212.GE19715@fm.suse.cz>

Sanity-ckeck config variable names when adding and retrieving them.  As a side
effect code duplication between git_config_set_multivar and get_value (in
builtin/config.c) was removed and the common functionality was placed in
git_config_parse_key.

This breaks a test in t1300 which used invalid section-less keys in the tests
for "git -c". However, allowing such names there was useless, since there was
no way to set them via config file, and no part of git actually tried to use
section-less keys. This patch updates the test to use more realistic examples.

Signed-off-by: Libor Pechacek <lpechacek@suse.cz>
Cc: Jeff King <peff@peff.net>
---
 builtin/config.c       |   17 +++++--
 cache.h                |    1 +
 config.c               |  107 ++++++++++++++++++++++++++++++-----------------
 t/t1300-repo-config.sh |    7 +--
 4 files changed, 84 insertions(+), 48 deletions(-)

diff --git a/builtin/config.c b/builtin/config.c
index ca4a0db..ba614e7 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -153,7 +153,6 @@ static int show_config(const char *key_, const char *value_, void *cb)
 static int get_value(const char *key_, const char *regex_)
 {
 	int ret = -1;
-	char *tl;
 	char *global = NULL, *repo_config = NULL;
 	const char *system_wide = NULL, *local;
 
@@ -168,17 +167,25 @@ static int get_value(const char *key_, const char *regex_)
 	}
 
 	key = xstrdup(key_);
-	for (tl=key+strlen(key)-1; tl >= key && *tl != '.'; --tl)
-		*tl = tolower(*tl);
-	for (tl=key; *tl && *tl != '.'; ++tl)
-		*tl = tolower(*tl);
 
 	if (use_key_regexp) {
+		char *tl;
+
+		/* TODO - this naive pattern lowercasing obviously does not
+		 * work for more complex patterns like `^[^.]*Foo.*bar' */
+		for (tl = key+strlen(key)-1; tl >= key && *tl != '.'; --tl)
+			*tl = tolower(*tl);
+		for (tl = key; *tl && *tl != '.'; ++tl)
+			*tl = tolower(*tl);
+
 		key_regexp = (regex_t*)xmalloc(sizeof(regex_t));
 		if (regcomp(key_regexp, key, REG_EXTENDED)) {
 			fprintf(stderr, "Invalid key pattern: %s\n", key_);
 			goto free_strings;
 		}
+	} else {
+		if (git_config_parse_key(key_, &key, NULL))
+			goto free_strings;
 	}
 
 	if (regex_) {
diff --git a/cache.h b/cache.h
index d83d68c..1e32d63 100644
--- a/cache.h
+++ b/cache.h
@@ -997,6 +997,7 @@ extern int git_config_maybe_bool(const char *, const char *);
 extern int git_config_string(const char **, const char *, const char *);
 extern int git_config_pathname(const char **, const char *, const char *);
 extern int git_config_set(const char *, const char *);
+extern int git_config_parse_key(const char *, char **, int *);
 extern int git_config_set_multivar(const char *, const char *, const char *, int);
 extern int git_config_rename_section(const char *, const char *);
 extern const char *git_etc_gitconfig(void);
diff --git a/config.c b/config.c
index 625e051..04a0c57 100644
--- a/config.c
+++ b/config.c
@@ -1098,6 +1098,72 @@ int git_config_set(const char *key, const char *value)
 	return git_config_set_multivar(key, value, NULL, 0);
 }
 
+/* Auxiliary function to sanity-check and split the key into the section
+ * identifier and variable name.
+ *
+ * Returns 0 on success, -1 when there is an invalid character in the key and
+ * -2 if there is no section name in the key.
+ *
+ * store_key - pointer to char* which will hold a copy of the key with
+ *             lowercase section and variable name, can be NULL
+ * baselen - pointer to int which will hold the length of the
+ *           section + subsection part, can be NULL
+ */
+int git_config_parse_key(const char *key, char **store_key, int *baselen_)
+{
+	int i, dot, baselen;
+	const char *last_dot = strrchr(key, '.');
+
+	/*
+	 * Since "key" actually contains the section name and the real
+	 * key name separated by a dot, we have to know where the dot is.
+	 */
+
+	if (last_dot == NULL) {
+		error("key does not contain a section: %s", key);
+		return -2;
+	}
+
+	baselen = last_dot - key;
+	if (baselen_)
+		*baselen_ = baselen;
+
+	/*
+	 * Validate the key and while at it, lower case it for matching.
+	 */
+	if (store_key)
+		*store_key = xmalloc(strlen(key) + 1);
+
+	dot = 0;
+	for (i = 0; key[i]; i++) {
+		unsigned char c = key[i];
+		if (c == '.')
+			dot = 1;
+		/* Leave the extended basename untouched.. */
+		if (!dot || i > baselen) {
+			if (!iskeychar(c) || (i == baselen+1 && !isalpha(c))) {
+				error("invalid key: %s", key);
+				goto out_free_ret_1;
+			}
+			c = tolower(c);
+		} else if (c == '\n') {
+			error("invalid key (newline): %s", key);
+			goto out_free_ret_1;
+		}
+		if (store_key)
+			(*store_key)[i] = c;
+	}
+	if (store_key)
+		(*store_key)[i] = 0;
+
+	return 0;
+
+out_free_ret_1:
+	if (store_key)
+		free(*store_key);
+	return -1;
+}
+
 /*
  * If value==NULL, unset in (remove from) config,
  * if value_regex!=NULL, disregard key/value pairs where value does not match.
@@ -1124,59 +1190,22 @@ int git_config_set(const char *key, const char *value)
 int git_config_set_multivar(const char *key, const char *value,
 	const char *value_regex, int multi_replace)
 {
-	int i, dot;
 	int fd = -1, in_fd;
 	int ret;
 	char *config_filename;
 	struct lock_file *lock = NULL;
-	const char *last_dot = strrchr(key, '.');
 
 	if (config_exclusive_filename)
 		config_filename = xstrdup(config_exclusive_filename);
 	else
 		config_filename = git_pathdup("config");
 
-	/*
-	 * Since "key" actually contains the section name and the real
-	 * key name separated by a dot, we have to know where the dot is.
-	 */
-
-	if (last_dot == NULL) {
-		error("key does not contain a section: %s", key);
-		ret = 2;
+	ret = git_config_parse_key(key, &store.key, &store.baselen);
+	if (ret)
 		goto out_free;
-	}
-	store.baselen = last_dot - key;
 
 	store.multi_replace = multi_replace;
 
-	/*
-	 * Validate the key and while at it, lower case it for matching.
-	 */
-	store.key = xmalloc(strlen(key) + 1);
-	dot = 0;
-	for (i = 0; key[i]; i++) {
-		unsigned char c = key[i];
-		if (c == '.')
-			dot = 1;
-		/* Leave the extended basename untouched.. */
-		if (!dot || i > store.baselen) {
-			if (!iskeychar(c) || (i == store.baselen+1 && !isalpha(c))) {
-				error("invalid key: %s", key);
-				free(store.key);
-				ret = 1;
-				goto out_free;
-			}
-			c = tolower(c);
-		} else if (c == '\n') {
-			error("invalid key (newline): %s", key);
-			free(store.key);
-			ret = 1;
-			goto out_free;
-		}
-		store.key[i] = c;
-	}
-	store.key[i] = 0;
 
 	/*
 	 * The lock serves a purpose in addition to locking: the new
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index d0e5546..3e79c37 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -876,11 +876,10 @@ test_expect_success 'check split_cmdline return' "
 	"
 
 test_expect_success 'git -c "key=value" support' '
-	test "z$(git -c name=value config name)" = zvalue &&
 	test "z$(git -c core.name=value config core.name)" = zvalue &&
-	test "z$(git -c CamelCase=value config camelcase)" = zvalue &&
-	test "z$(git -c flag config --bool flag)" = ztrue &&
-	test_must_fail git -c core.name=value config name
+	test "z$(git -c foo.CamelCase=value config foo.camelcase)" = zvalue &&
+	test "z$(git -c foo.flag config --bool foo.flag)" = ztrue &&
+	test_must_fail git -c name=value config core.name
 '
 
 test_done
-- 
1.7.4.rc2.20.gdb1b81

^ permalink raw reply related

* Re: [PATCH] Documentation fixes in git-config
From: Libor Pechacek @ 2011-01-21 10:20 UTC (permalink / raw)
  To: Jeff King; +Cc: git
In-Reply-To: <20110121002716.GC9442@sigill.intra.peff.net>

On Thu 20-01-11 19:27:16, Jeff King wrote:
> The intent of the change looks fine, but your sentence doesn't quite
> parse to me (to be fair, the problem is in the one you are replacing,
> but adding the third clause makes it even more confusing). How about:
> 
>   The variables names are case-insensitive, allow only alphanumeric
>   characters and '-', and must start with an alphabetic character.

I like that very much.  The original sentence sounded a little bit artificial
to me, and after my amendments it felt like a collapsed list of items.  This is
far more natural, thanks for help.

> >  --get-regexp::
> >  	Like --get-all, but interprets the name as a regular expression.
> > -	Also outputs the key names.
> > +	Regular expression matching is case sensitive in all parts of the key,
> > +	therefore make sure your pattern matches lower case letters in section
> > +	and variable names.  Also outputs the key names.
> 
> That is only true because of the breakage in your first patch. Without
> your patch, both of these work:
> 
>   git config --get-regexp 'Foo.*'
>   git config --get-regexp 'foo.*'
>
> That being said, the downcasing is extremely naive for regexps, and you
> should try to match the canonical name. The current downcasing behavior
> should probably stay for historical reasons, but is not well thought-out
> (it may even be accidental). Perhaps we should therefore explain it in
> those terms:
> 
>   Regular expression matching is case-sensitive and done against a
>   canonicalized version of the key in which section and variable names
>   are lowercased, but subsection names are not. For historical reasons,
>   some simple regular expressions are lower-cased before matching
>   (everything before the first dot and after the last dot), which makes
>   things like "Core.*' work.
> 
> I dunno. Maybe we should just declare "Core.*' to be broken, and anybody
> who was relying on it is wrong.

After thinking about it more, I realized that the goal is to have a "mixed
case-sensitivity" regexp matching.  The case sensitivity if of course
determined by the part of the key which is being processed, and not the pattern
itself.  That probably means changes in the regexp mathing sengine.

Declaring patterns like 'Core.*' invalid would be a step back in my opinion.

Therefore I've added the regexp lowercasing code back and documented the
limitation.  I believe it's fair to the users.

Updated patches will follow in a while.

Libor
-- 
Libor Pechacek
SUSE L3 Team, Prague

^ permalink raw reply

* Re: Parameter --color-words not documented for "git show"
From: Maaartin @ 2011-01-21 10:08 UTC (permalink / raw)
  To: Jeff King
  Cc: Nicolas Sebrecht, Junio C Hamano, Sebastian Pipping, Thomas Rast,
	Git ML
In-Reply-To: <20110120233429.GB9442@sigill.intra.peff.net>

On 11-01-21 00:34, Jeff King wrote:
> On Fri, Jan 21, 2011 at 12:16:49AM +0100, Nicolas Sebrecht wrote:

>   4. Do (3), but also list the all (or common) diff options in a succint
>      list without descriptions, and refer the user to git-diff(1). Then
>      they can grep if they like, and while they won't get the immediate
>      answer, they will get referred to the right place.
> 
> As you can probably guess, I favor option (4), though we already do (3)
> in some places.

I also favor (4), for the following reasons:

- sometimes you want to read the whole manpage, e.g., it's good for
beginners to get feeling what is it all about.

- repeated information makes the page too long and reading too boring.

- too long manpages may scare beginners.

Maybe there could be sort-of extended manpage, containing everything,
but it would need some markup beyond the capabilities of a terminal (a
grayed or collapsed area in html, or whatever). However, this could be a
lot of additional work, and I don't claim it should be done, just an idea.

^ 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