Git development
 help / color / mirror / Atom feed
* Re: How to remove a specific hunk
From: Florian Weimer @ 2007-10-31 11:56 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Benoit SIGOURE, Alex Riesen, git list
In-Reply-To: <Pine.LNX.4.64.0710311104450.4362@racer.site>

* Johannes Schindelin:

> You have seen that there are two different file lists, "staged
> changes" and "unstaged changes", right?  AFAIK if you click on the
> file in "staged changes", you can find the staged hunk and then
> remove it from the staged area.
>
> "Revert hunk" would not make any sense, since the hunk disappears
> once you staged/unstaged it.

I think Benoit wants to remove it from the working copy (and,
presumably, the index too).  "Revert hunk" and "Move hunk to stash"
might indeed be useful additions to citool.

-- 
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99

^ permalink raw reply

* Re: How to remove a specific hunk
From: Johannes Schindelin @ 2007-10-31 11:06 UTC (permalink / raw)
  To: Benoit SIGOURE; +Cc: Alex Riesen, git list
In-Reply-To: <13D08D3F-3647-4E20-AF80-8EC6FD14E66A@lrde.epita.fr>

Hi,

On Wed, 31 Oct 2007, Benoit SIGOURE wrote:

> On Oct 26, 2007, at 9:20 PM, Alex Riesen wrote:
> 
> > Pascal Obry, Fri, Oct 26, 2007 17:10:38 +0200:
> > > 
> > > I'm very new to Git... but start to love it :)
> > > 
> > > Before committing sometimes I want to remove a specific hunk. Say in
> > > file a.txt I have in the diff 3 hunks, I want to revert/delete/remove
> > > the second one. Is there a way to do that ?
> > 
> > Take a look at git-gui. Try right-clicking in the diff pane at the
> > bottom.
> 
> This only allows you to stage a given hunk, not to remove one.  Right 
> now I'm in a situation where I need to remove a specific hunk to compile 
> and it's sad that git-gui doesn't provide an option so that you can 
> right-click -> revert hunk.

You have seen that there are two different file lists, "staged changes" 
and "unstaged changes", right?  AFAIK if you click on the file in "staged 
changes", you can find the staged hunk and then remove it from the staged 
area.

"Revert hunk" would not make any sense, since the hunk disappears once you 
staged/unstaged it.

Ciao,
Dscho

^ permalink raw reply

* Re: Recording merges after repo conversion
From: Johannes Schindelin @ 2007-10-31 11:01 UTC (permalink / raw)
  To: Peter Karlsson; +Cc: Lars Hjemli, Benoit SIGOURE, git
In-Reply-To: <Pine.LNX.4.62.0710311048450.13264@perkele.intern.softwolves.pp.se>

Hi,

On Wed, 31 Oct 2007, Peter Karlsson wrote:

> Johannes Schindelin:
> 
> > Why should it?  This would contradict the whole "a commit sha1 hashes 
> > the commit, and by inference the _whole_ history" principle.
> 
> Does it?

Yes!  Of course!  If what you want becomes possible, I could make an evil 
change in history long gone, and slip it by you.  You could not even see 
the history which changed.

> Why can't the grafts file itself be committed to the repository and live 
> in the history?

You can do that already.  But you have to ask the people at the other end 
to actually apply the graft.

> Well, yeah, the SHA1 hashing is one of Git's main strengths, but it also
> opens up some weaknesses.

If you really think that, I doubt you understood the issues at hand.

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH 10/10] push: teach push to be quiet if local ref is strict subset of remote ref
From: Steffen Prohaska @ 2007-10-31 10:50 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7v8x5jiseh.fsf@gitster.siamese.dyndns.org>


On Oct 31, 2007, at 9:45 AM, Junio C Hamano wrote:

>> - git push can be configuration to push only the current
>>   branch, as outlined below. This would certainly work. What
>>   I do not like is that you first need to do some configuration
>>   before you get a safe working environment.
>
> I would not doubt it would be safer for _your_ workflow, but you
> should consider the risk of making things more cumbersome for
> workflows of others by enforcing that policy.

Together with the '--create' flag it would be safer in all
cases, because it would always do _less_ than what git push
currently does. The safest choice would be if "git push"
refused to do anything until configured appropriately.

"safer" is independent of the workflow.

But I see that it may be more cumbersome depending on the
workflow.

I'm mainly interested in using git against a shared repo,
and make it as simple and as safe as possible to use in
such a setup. I suspect that git is more optimized for the
workflow used for the Linux kernel and for developing git,
which heavily rely on sending patches to mailing lists and
pulling fro read-only repos.


> In other words, don't change anything unless you have a very
> good reason to convince everybody else that it is universally
> a good change to the default.

What I can imagine would not be universally better, but it
would be universally safer. You'd need to either explicitly
tell git push how to act (e.g. '--current' or '--matching'
flags), or you could explicitly configure git to always act in
a specific way. But it would only start to act this way _after_
being configured appropriately.

	Steffen

^ permalink raw reply

* Re: Possible bug: git-svn leaves broken tree in case of error
From: Karl Hasselström @ 2007-10-31 10:23 UTC (permalink / raw)
  To: Eric Wong; +Cc: Anton Korobeynikov, git
In-Reply-To: <20071031084257.GA2911@mayonaise>

On 2007-10-31 01:42:57 -0700, Eric Wong wrote:

> Warning instead of die-ing here is not a good option, because it can
> lead to inconsistent author data inside populating history. I
> believe it's better to error out immediately so the user can fix
> their authors file.

Yes, that seems to be the only sensible opition.

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

^ permalink raw reply

* Re: How to remove a specific hunk
From: Benoit SIGOURE @ 2007-10-31 10:10 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git list
In-Reply-To: <20071026192034.GA3062@steel.home>

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

On Oct 26, 2007, at 9:20 PM, Alex Riesen wrote:

> Pascal Obry, Fri, Oct 26, 2007 17:10:38 +0200:
>>
>> I'm very new to Git... but start to love it :)
>>
>> Before committing sometimes I want to remove a specific hunk. Say in
>> file a.txt I have in the diff 3 hunks, I want to revert/delete/remove
>> the second one. Is there a way to do that ?
>
> Take a look at git-gui. Try right-clicking in the diff pane at the
> bottom.

This only allows you to stage a given hunk, not to remove one.  Right  
now I'm in a situation where I need to remove a specific hunk to  
compile and it's sad that git-gui doesn't provide an option so that  
you can right-click -> revert hunk.

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply

* Re: Recording merges after repo conversion
From: Peter Karlsson @ 2007-10-31  9:50 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Lars Hjemli, Benoit SIGOURE, git
In-Reply-To: <Pine.LNX.4.64.0710310227340.4362@racer.site>

Johannes Schindelin:

> Why should it?  This would contradict the whole "a commit sha1 hashes the
> commit, and by inference the _whole_ history" principle.

Does it? Why can't the grafts file itself be committed to the repository and 
live in the history?

Well, yeah, the SHA1 hashing is one of Git's main strengths, but it also 
opens up some weaknesses.

-- 
\\// Peter - http://www.softwolves.pp.se/

^ permalink raw reply

* Re: remote#branch
From: Pascal Obry @ 2007-10-31  9:34 UTC (permalink / raw)
  To: David Kastrup
  Cc: Jeff King, Linus Torvalds, Matthieu Moy, Tom Prince, Theodore Tso,
	Junio C Hamano, Jan Hudec, Johannes Schindelin, Petr Baudis,
	Paolo Ciarrocchi, git
In-Reply-To: <85pryvzt1h.fsf@lola.goethe.zz>

David Kastrup a écrit :
> You just write <URL:http://host/git repo with spaces in the path> and
> have a good chance it will work.

Well "good chance" is not an option for reliable software :)

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595

^ permalink raw reply

* Re: remote#branch
From: Pascal Obry @ 2007-10-31  9:33 UTC (permalink / raw)
  To: Jeff King; +Cc: Jakub Narebski, git
In-Reply-To: <20071031015708.GA24403@coredump.intra.peff.net>

Jeff King a écrit :
>   'http://foo.tld/url with a space'
> 
> rather than:
> 
>   http://foo.tld/url+with+a+space
> 
> ?
> 
> I think the latter is much more common, if only because of the fact that
> copy and paste from most browsers' location bars gives the encoded
> version.

I agree 100%. It is the more common as it follows the standard encoding.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595

^ permalink raw reply

* Re: remote#branch
From: Mike Hommey @ 2007-10-31  9:15 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: Jeff King, Jakub Narebski, git
In-Reply-To: <472844D4.8050306@op5.se>

On Wed, Oct 31, 2007 at 10:03:16AM +0100, Andreas Ericsson <ae@op5.se> wrote:
> >Or copied from gitweb.
> >
> 
> Perhaps, but I've never seen that done. Partly because you can't be sure
> the HTTP url is the same as the git address (perhaps people are used to
> this from CVS and the likes), and partly because you'd, for most cases,
> want to use git:// or ssh transport instead of http.
> 
> It might be nifty to have gitweb print some git-valid locator for a repo
> though, or even a full copy-pastable "git clone git://host/path/to/repo.git"
> command-line thingie. I'll look into it when I have leisure.

Hum... it already does print http and git "Mirror URL"s which are ready to
be copy/pasted to feed git clone arguments.

Mike

^ permalink raw reply

* Re: [PATCH 10/10] push: teach push to be quiet if local ref is strict subset of remote ref
From: Junio C Hamano @ 2007-10-31  9:14 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: git
In-Reply-To: <7v8x5jiseh.fsf@gitster.siamese.dyndns.org>

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

>  1. Error on the sending side.  The ref parameters given to
>     git-push were bogus, or they were good commits but they were
>     not fully connected to the commits the other side has
>     (i.e. local repository corruption).  pack-objects will abort
>     and no remote (nor local tracking ref that tracks what we
>     pushed to the remote) would be updated.  This should be
>     "most severe" in _any_ workflow, so I do not mind calling
>     this "fatal".

By the way, as git-push allows an arbitrary SHA-1 on the left
hand side of a refspec, you can have the above error without a
corrupted repository.  Here is how.

 * You run git-fetch from elsewhere.  It is a small fetch and we
   decide not to keep the pack (iow, run unpack-objects instead
   of index-pack on the local side).  Or the fetch is over dumb
   transport that walks commits one-by-one.

   This git-fetch is interrupted.  We do _not_ update any refs
   in such a case, but we do not eradicate loose objects that
   were downloaded.  They stay dangling.

 * You push one of the commits downloaded above.  I.e. it is
   not connected to any of your ref.

^ permalink raw reply

* Re: remote#branch
From: Andreas Ericsson @ 2007-10-31  9:03 UTC (permalink / raw)
  To: Mike Hommey; +Cc: Jeff King, Jakub Narebski, git
In-Reply-To: <20071031083506.GA23316@glandium.org>

Mike Hommey wrote:
> On Wed, Oct 31, 2007 at 08:09:01AM +0100, Andreas Ericsson <ae@op5.se> wrote:
>> Jeff King wrote:
>>> On Wed, Oct 31, 2007 at 02:49:16AM +0100, Jakub Narebski wrote:
>>>
>>>>> ...which is a quoting mechanism, and it's not even one commonly used in
>>>>> emails (i.e., people have written "parse a URL from this text" scripts
>>>>> for RFC-encoded URLs, but _not_ for shell quoting).
>>>> I don't think RFC-encoding is quoting mechanism used in emails, either.
>>> That's funny, because I have hundreds of mails where that is the case,
>>> and none where people used shell-quoting.  Most URLs don't _need_ any
>>> encoding, so we don't notice either way. But are you honestly telling me
>>> that if you needed to communicate a URL with a space via email, you
>>> would write:
>>>
>>>  'http://foo.tld/url with a space'
>>>
>>> rather than:
>>>
>>>  http://foo.tld/url+with+a+space
>>>
>>> ?
>>>
>> I think 99% of all URL's communicated via email are copy-pasted from a
>> webbrowsers location bar. I believe most git urls (or grls, or whatever
>> you wanna call them) communicated via email are copy-pasted from ones
>> config, or written out manually.
> 
> Or copied from gitweb.
> 

Perhaps, but I've never seen that done. Partly because you can't be sure
the HTTP url is the same as the git address (perhaps people are used to
this from CVS and the likes), and partly because you'd, for most cases,
want to use git:// or ssh transport instead of http.

It might be nifty to have gitweb print some git-valid locator for a repo
though, or even a full copy-pastable "git clone git://host/path/to/repo.git"
command-line thingie. I'll look into it when I have leisure.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply

* Re: [PATCH 10/10] push: teach push to be quiet if local ref is strict subset of remote ref
From: Junio C Hamano @ 2007-10-31  8:45 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: git
In-Reply-To: <F5F68690-68A3-4AFC-A79C-FF02910F0359@zib.de>

Steffen Prohaska <prohaska@zib.de> writes:

> Would it be acceptable if the error was less severe in the
> case of local being a strict subset of remote?
> Daniel proposed
> "%s: nothing to push to %s, but you are not up-to-date and
> may want to pull"
> It would still be an error, but a less severe one.

I am not convinced there is one true total order of "error
severity" that applies uniformly across different workflows, so
I would not immediately agree if you are suggesting to introduce
"severity levels".  But it certainly makes a lot of sense to be
able to _differentiate_ kinds of errors, and to have the calling
scripts and the push command itself react to them.

What are the possible error conditions?

 1. Error on the sending side.  The ref parameters given to
    git-push were bogus, or they were good commits but they were
    not fully connected to the commits the other side has
    (i.e. local repository corruption).  pack-objects will abort
    and no remote (nor local tracking ref that tracks what we
    pushed to the remote) would be updated.  This should be
    "most severe" in _any_ workflow, so I do not mind calling
    this "fatal".

 2. Push to a ref does fast forward, but the update hook on the
    remote side declines.  The ref on the remote nor the
    corresponding local tracking ref would not be updated, and
    the command would fail.

For all the other classes of errors, the ref on the remote nor
the corresponding local tracking ref would not be updated, and
by default, an error on any ref causes the command to error out.
For each of these classes of errors, we _could_ have an option
to let you tell the command not to error out because of it.

 3. Push to a ref does not fast forward and --force is not
    given, but you can prove the remote is strict subset of
    local (what your 10/10 wants to do).

 4. Same as #3 but you cannot prove the remote is strict subset
    of local.

Any other classes?

It might be a good idea to generalize 3 & 4, by the way.  The
remote being a strict descendant of what is being pushed might
be something you happened to want today, but somebody else may
come up with a different rule tomorrow.  So, 

 3'. Push to a ref does not fast forward and --force is not
     given, but there is a configuration (would this be per
     remote?, per remote branch?, or per local branch?) that
     tells git-push to call a hook on the local side that takes
     <ref being pushed, ref on the remote> as its parameter.
     The result from the hook does not change the fact that this
     is still an error, but it can instruct git-push not to
     error out due to this condition.

In some other workflows, it might make sense to maybe even
making 2. not to cause the error from git-push.  I dunno.

> It could also be a good idea to teach git push transactional
> behaviour.

That is certainly true.  I am not sure about other transports,
but it should be a relatively straightforward protocol extension
for the git native transport.

> - git push can be configuration to push only the current
>   branch, as outlined below. This would certainly work. What
>   I do not like is that you first need to do some configuration
>   before you get a safe working environment.

I would not doubt it would be safer for _your_ workflow, but you
should consider the risk of making things more cumbersome for
workflows of others by enforcing that policy.

In other words, don't change anything unless you have a very
good reason to convince everybody else that it is universally
a good change to the default.

^ permalink raw reply

* Re: Possible bug: git-svn leaves broken tree in case of error
From: Eric Wong @ 2007-10-31  8:42 UTC (permalink / raw)
  To: Anton Korobeynikov; +Cc: git
In-Reply-To: <20071031075524.GB7798@muzzle>

Eric Wong <normalperson@yhbt.net> wrote:
> Anton Korobeynikov <asl@math.spbu.ru> wrote:
> > Hello, Everyone.
> > 
> > I noticed this bug several times. Consider the following conditions are
> > met:
> > - We're syncing from svn using git-svn :)
> > - We have authors file provided
> > - We have a changeset with author unlisted in the authors file.
> > 
> > git-svn dies due to the following code:
> > sub check_author {
> >         my ($author) = @_;
> >         if (!defined $author || length $author == 0) {
> >                 $author = '(no author)';
> >         }
> >         if (defined $::_authors && ! defined $::users{$author}) {
> >                 die "Author: $author not defined in $::_authors file\n";
> >         }
> >         $author;
> > }
> > 
> > Unfortunately it leaves repository in some middle state: git-svn itself
> > thinks, that it synced with everything, but git itself doesn't "see" any
> > changesets anymore. I found no way to repair tree after such situation,
> > so I had to repull from scratch.
> > 
> > I found myself, that this should be warning (and fix in this case is
> > trivial), not error (maybe some commandline switch to control behaviour,
> > etc). It can be even error, but breaking tree is definitely bug in this
> > case.
> 
> You should be able to change the numbers in *-maxRev back to
> an old revision in .git/svn/.metadata.  Does that fix things for you
> so you can resume synching again?
> 
> I'll have to investigate the die()-ing of check_authors since
> that should cause git-svn to quit before the maxRev numbers
> get incremented.

With the following test case, I'm not able to reproduce what you're
describing.

But yes, die-ing here and not being able to gracefully recover is a
nasty bug...

Warning instead of die-ing here is not a good option, because it can
lead to inconsistent author data inside populating history.  I believe
it's better to error out immediately so the user can fix their authors
file.

diff --git a/t/t9117-git-svn-authors-file.sh b/t/t9117-git-svn-authors-file.sh
new file mode 100755
index 0000000..4566307
--- /dev/null
+++ b/t/t9117-git-svn-authors-file.sh
@@ -0,0 +1,85 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Eric Wong
+#
+
+test_description='git-svn authors file tests'
+
+. ./lib-git-svn.sh
+
+cat > svn-authors <<EOF
+aa = AAAAAAA AAAAAAA <aa@example.com>
+bb = BBBBBBB BBBBBBB <bb@example.com>
+EOF
+
+test_expect_success 'setup svnrepo' "
+	svn mkdir -m aa --username aa $svnrepo/aa &&
+	svn mkdir -m bb --username bb $svnrepo/bb &&
+	svn mkdir -m cc --username cc $svnrepo/cc &&
+	svn mkdir -m dd --username dd $svnrepo/dd
+	"
+
+test_expect_failure 'start import with incomplete authors file' "
+	git-svn clone --authors-file=svn-authors $svnrepo x
+	"
+
+test_expect_success 'imported 2 revisions successfully' "
+	cd x &&
+		test \`git rev-list refs/remotes/git-svn | wc -l\` -eq 2 &&
+		git rev-list -1 --pretty=raw refs/remotes/git-svn | \
+		  grep '^author BBBBBBB BBBBBBB <bb@example\.com> ' &&
+		git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
+		  grep '^author AAAAAAA AAAAAAA <aa@example\.com> ' &&
+		cd ..
+	"
+
+cat >> svn-authors <<EOF
+cc = CCCCCCC CCCCCCC <cc@example.com>
+dd = DDDDDDD DDDDDDD <dd@example.com>
+EOF
+
+test_expect_success 'continues to import once authors have been added' "
+	cd x &&
+		git-svn fetch --authors-file=../svn-authors &&
+		test \`git rev-list refs/remotes/git-svn | wc -l\` -eq 4 &&
+		git rev-list -1 --pretty=raw refs/remotes/git-svn | \
+		  grep '^author DDDDDDD DDDDDDD <dd@example\.com> ' &&
+		git rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \
+		  grep '^author CCCCCCC CCCCCCC <cc@example\.com> ' &&
+		cd ..
+	"
+
+test_expect_success 'authors-file against globs' "
+	svn mkdir -m globs --username aa \
+	  $svnrepo/aa/trunk $svnrepo/aa/branches $svnrepo/aa/tags &&
+	git-svn clone --authors-file=svn-authors -s $svnrepo/aa aa-work &&
+	svn mkdir -m aa/branches/bb --username bb $svnrepo/aa/branches/bb &&
+	svn mkdir -m aa/branches/ee --username ee $svnrepo/aa/branches/ee &&
+	svn mkdir -m aa/branches/cc --username cc $svnrepo/aa/branches/cc
+	"
+
+test_expect_failure 'fetch fails on ee' "
+	cd aa-work &&
+		git-svn fetch --authors-file=../svn-authors
+	"
+
+tmp_config_get () {
+	GIT_CONFIG=.git/svn/.metadata git config --get "$1"
+}
+
+test_expect_success 'failure happened without negative side effects' "
+	test 6 -eq \"\`tmp_config_get svn-remote.svn.branches-maxRev\`\" &&
+	test 6 -eq \"\`tmp_config_get svn-remote.svn.tags-maxRev\`\"
+	"
+
+cat >> ../svn-authors <<EOF
+ee = EEEEEEE EEEEEEE <ee@example.com>
+EOF
+
+test_expect_success 'fetch continues after authors-file is fixed' "
+	git-svn fetch --authors-file=../svn-authors &&
+	test 8 -eq \"\`tmp_config_get svn-remote.svn.branches-maxRev\`\" &&
+	test 8 -eq \"\`tmp_config_get svn-remote.svn.tags-maxRev\`\"
+	"
+
+test_done

-- 
Eric Wong

^ permalink raw reply related

* Re: remote#branch
From: Mike Hommey @ 2007-10-31  8:35 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: Jeff King, Jakub Narebski, git
In-Reply-To: <47282A0D.9010400@op5.se>

On Wed, Oct 31, 2007 at 08:09:01AM +0100, Andreas Ericsson <ae@op5.se> wrote:
> Jeff King wrote:
> >On Wed, Oct 31, 2007 at 02:49:16AM +0100, Jakub Narebski wrote:
> >
> >>>...which is a quoting mechanism, and it's not even one commonly used in
> >>>emails (i.e., people have written "parse a URL from this text" scripts
> >>>for RFC-encoded URLs, but _not_ for shell quoting).
> >>I don't think RFC-encoding is quoting mechanism used in emails, either.
> >
> >That's funny, because I have hundreds of mails where that is the case,
> >and none where people used shell-quoting.  Most URLs don't _need_ any
> >encoding, so we don't notice either way. But are you honestly telling me
> >that if you needed to communicate a URL with a space via email, you
> >would write:
> >
> >  'http://foo.tld/url with a space'
> >
> >rather than:
> >
> >  http://foo.tld/url+with+a+space
> >
> >?
> >
> 
> I think 99% of all URL's communicated via email are copy-pasted from a
> webbrowsers location bar. I believe most git urls (or grls, or whatever
> you wanna call them) communicated via email are copy-pasted from ones
> config, or written out manually.

Or copied from gitweb.

Mike

^ permalink raw reply

* Re: [PATCH 1/1] Add --first-parent support to interactive rebase.
From: Wincent Colaiuta @ 2007-10-31  8:24 UTC (permalink / raw)
  To: Björn Steinbrink; +Cc: Johannes Schindelin, git
In-Reply-To: <20071031041751.GA3326@atjola.homenet>

El 31/10/2007, a las 5:17, Björn Steinbrink escribió:

> How about:
> \--first-parent::
> 	When this option is given and --preserve-merges is not, then
> 	merge commits are completely ignored and only commits from the
> 	first parent ancestry are rebased. This allows to pretend that
> 	merges never happened.
>
> 	If --preserve-merges is also given, the merge commits are
> 	preserved, but only their first parent is rebased as opposed to
> 	the default behaviour which would rebase all parents.


Minor nitpick:

-	first parent ancestry are rebased. This allows to pretend that
+	first parent ancestry are rebased. This allows you to pretend that

Cheers,
Wincent

^ permalink raw reply

* Re: remote#branch
From: Robin Rosenberg @ 2007-10-31  8:25 UTC (permalink / raw)
  To: David Kastrup
  Cc: Jeff King, Linus Torvalds, Pascal Obry, Matthieu Moy, Tom Prince,
	Theodore Tso, Junio C Hamano, Jan Hudec, Johannes Schindelin,
	Petr Baudis, Paolo Ciarrocchi, git
In-Reply-To: <85pryvzt1h.fsf@lola.goethe.zz>

onsdag 31 oktober 2007 skrev David Kastrup:
> Jeff King <peff@peff.net> writes:
> 
> > On Tue, Oct 30, 2007 at 12:38:27PM -0700, Linus Torvalds wrote:
> >
> >> So if you want to follow the RFC, you'd better give a real reason. And no, 
> >> the existence of an RFC, and the fact that people use the same name for 
> >> things that superficially _look_ the same is not a reason in itself.
> >> 
> >> So hands up, people. Anybody who asked for RFC quoting. Give a damn 
> >> *reason* already!
> >
> > I didn't ask for RFC quoting, but a nice side effect of URL syntax is
> > that they are machine parseable. If you wanted to write a tool to pick
> > the URLs out of this email and clone them as git repos, then how do you
> > find the end of:
> >
> >   http://host/git repo with spaces in the path
> >
> > compared to:
> >
> >   http://host/git+repo+with+spaces+in+the+path
> 
> You just write <URL:http://host/git repo with spaces in the path> and
> have a good chance it will work.

It doesn't with KMail.

-- robin

^ permalink raw reply

* Re: remote#branch
From: Wincent Colaiuta @ 2007-10-31  8:16 UTC (permalink / raw)
  To: David Kastrup
  Cc: Jeff King, Linus Torvalds, Pascal Obry, Matthieu Moy, Tom Prince,
	Theodore Tso, Junio C Hamano, Jan Hudec, Johannes Schindelin,
	Petr Baudis, Paolo Ciarrocchi, git
In-Reply-To: <85pryvzt1h.fsf@lola.goethe.zz>

El 31/10/2007, a las 7:39, David Kastrup escribió:

> Jeff King <peff@peff.net> writes:
>
>> I didn't ask for RFC quoting, but a nice side effect of URL syntax is
>> that they are machine parseable. If you wanted to write a tool to  
>> pick
>> the URLs out of this email and clone them as git repos, then how do  
>> you
>> find the end of:
>>
>>  http://host/git repo with spaces in the path
>>
>> compared to:
>>
>>  http://host/git+repo+with+spaces+in+the+path
>
> You just write <URL:http://host/git repo with spaces in the path> and
> have a good chance it will work.

As a data point, my email client correctly highlights only this one as  
a URL:

http://host/git+repo+with+spaces+in+the+path

Both of these are incorrectly highlighted:

http://host/git repo with spaces in the path
<URL:http://host/git repo with spaces in the path>

And this one too:

<http://host/git repo with spaces in the path>

So what does this mean in practice? I can right-click on the first one  
and choose "Copy". All the other ones I have to left-click and drag,  
being careful to limit the selection to the appropriate left and right  
boundaries.

Whether or not this is a big enough deal to actually care about is  
open to debate (obviously). Personally, I don't care too much seeing  
as I never use paths with spaces in them for this kind of thing.

Cheers,
Wincent

^ permalink raw reply

* Re: Possible bug: git-svn leaves broken tree in case of error
From: Eric Wong @ 2007-10-31  7:55 UTC (permalink / raw)
  To: Anton Korobeynikov; +Cc: git
In-Reply-To: <1193729426.30755.32.camel@asl.dorms.spbu.ru>

Anton Korobeynikov <asl@math.spbu.ru> wrote:
> Hello, Everyone.
> 
> I noticed this bug several times. Consider the following conditions are
> met:
> - We're syncing from svn using git-svn :)
> - We have authors file provided
> - We have a changeset with author unlisted in the authors file.
> 
> git-svn dies due to the following code:
> sub check_author {
>         my ($author) = @_;
>         if (!defined $author || length $author == 0) {
>                 $author = '(no author)';
>         }
>         if (defined $::_authors && ! defined $::users{$author}) {
>                 die "Author: $author not defined in $::_authors file\n";
>         }
>         $author;
> }
> 
> Unfortunately it leaves repository in some middle state: git-svn itself
> thinks, that it synced with everything, but git itself doesn't "see" any
> changesets anymore. I found no way to repair tree after such situation,
> so I had to repull from scratch.
> 
> I found myself, that this should be warning (and fix in this case is
> trivial), not error (maybe some commandline switch to control behaviour,
> etc). It can be even error, but breaking tree is definitely bug in this
> case.

You should be able to change the numbers in *-maxRev back to
an old revision in .git/svn/.metadata.  Does that fix things for you
so you can resume synching again?

I'll have to investigate the die()-ing of check_authors since
that should cause git-svn to quit before the maxRev numbers
get incremented.

-- 
Eric Wong

^ permalink raw reply

* Re: [PATCH 10/10] push: teach push to be quiet if local ref is strict subset of remote ref
From: Steffen Prohaska @ 2007-10-31  7:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vejfcl8aj.fsf@gitster.siamese.dyndns.org>


On Oct 30, 2007, at 8:19 PM, Junio C Hamano wrote:

> Steffen Prohaska <prohaska@zib.de> writes:
>
>> On Oct 30, 2007, at 9:29 AM, Junio C Hamano wrote:
>>
>>> It simply is insane to make this strange rule 10/10 introduces
>>> the default behaviour.  It is too specific to a particular
>>> workflow (that is, working with a shared central repository,
>>> having many locally tracking branches that are not often used
>>> and become stale, and working on only things to completion
>>> between pushes).
>>
>> I don't think its very strange behaviour if you see it in the
>> light of what the user wants to achieve. We are talking about
>> the case were only fast forward pushes are allowed. So, we
>> only talk about a push that has the goal of adding new local
>> changes to the remote. The user says "git push" and means
>> push my new local changes to the remote.
>
> If you want to push a specific subset of branches, you should
> not be invoking the "matching refs" to begin with.  And breaking
> the "matching refs" behaviour is not the way to fix it.

ok.

So, git push shall guarantee that all matching refs point
to the _same_ commit if a push was successful. Otherwise,
git push shall report an error.

Would it be acceptable if the error was less severe in the
case of local being a strict subset of remote?
Daniel proposed
"%s: nothing to push to %s, but you are not up-to-date and
may want to pull"
It would still be an error, but a less severe one.

It could also be a good idea to teach git push transactional
behaviour. It could check in advance ('--dry-run') if the
push will succeed. If not it should report the errors without
actually pushing. Then, _nothing_ would have been changed on
the remote. Only if everything is ok "git push" would modify
the remote. Well, I think it might be hard to avoid the race
condition when someone else pushes simultaneously to a shared
repo. But this hopefully rarely happens.


> You can rewind a wrong branch by mistake locally and run push.
> With your change you would not notice that mistake.
>
>         $ git checkout bar
>         $ work work work; commit commit commit
> 	$ git checkout test
>         $ git merge bar
> 	... integrate, build, test
>         ... notice that the tip commit of bar is not ready
>         $ git checkout foo ;# oops, mistake
>         $ git reset --hard HEAD^
> 	$ git push
>
> If you checked out foo instead of bar by mistake at the last
> "git checkout" step like this, your change will make 'foo' an
> ancestor of the other side of the connection, and push silently
> ignores it instead of failing.

Yes, there are many ways you can mess up ;)


> Also, the behaviour is too specific to your workflow of working
> on things only to completion between pushes.  If you work a bit
> on branch 'foo' (but not complete), and work much on branch
> 'bar', 'baz', and 'boo' making all of them ready to be
> published, you cannot say "git push" anyway.  Instead you have
> to say "git push $remote bar baz boo".

Ok and this is the root why I work only to completion between
pushes. I tried to figure out a "safe" workflow. If you
accidentally type "git push" nothing wrong should happen. I
am sure that people will sometimes type "git push" forgetting
to mention anything. At least, I am sure that _I_ will do this.

The only comfortable way to make "git push" safe with
the current behaviour is to work on local branches only to
completion. Then, you can push to any repository at any time
and nothing bad can happen.

Alternatives with existing git are

- never use "git push", but always tell git explicitly what you
   want. This is too dangerous for me because at some point I'll
   type "git push". The problem with "git push" is that it's
   really hard to undo. It's near to impossible if you pushed
   to a public remote. Therefore, I really want to avoid this danger.

- Configure specific push rules for remotes that switch off
   the "matching branches" default. You can for example 'switch'
   off the default by configuring
   "remote.$remote.push = nonexisting". But then I started
   to get annoyed by all the configuration work. I do not want
   to explain such details to people who get started with git.
   And you do not get reasonable messages either. And btw I'd
   prefer if git push just did the right thing.


Alternatives that require changing git push are

- git push would do _nothing_ by default. git push would ask
   "what do you mean? Need at least a remote, or better remote
    and branch."
   Options could be provided to push current branch (--current)
   or all matching branches (--matching).

- git push _by default_ would only push the current branch. This
   would at least be a "safer" default.

- git push would first run --dry-run and then ask for
   confirmation. Something like:
   "Do you really want to push this to that remote? Here is
   the URL and the branches. Did you really mean this?
   WARNING: you can't undo this operation. And btw if you say
   yes, I'll report errors anyway because some remotes are not
   strict subsets. So maybe you want to fix things first."

- git push can be configuration to push only the current
   branch, as outlined below. This would certainly work. What
   I do not like is that you first need to do some configuration
   before you get a safe working environment.


> This discourages people from making commits that are not ready
> to be published, which is a very wrong thing to do, as a major
> selling point of distributed revision control is the
> dissociation between committing and publishing.

Yes, the current default behaviour of git push discourages me
to work that way.


> You work and commit freely, and at any point some of your
> branches are ready to be published while some others
> aren't. Inconvenience of "matching refs" may need to be worked
> around.  I liked your "current branch only", with "git push
> $remote HEAD" (I presume that "remote.$remote.push = HEAD" and
> "branch.$current.remote = $remote" would let you do that with
> "git push"), exactly because the way it specifies which branch
> is to be published is very clearly defined and easy to
> understand.  This "matching but only ff" does not have that
> attractive clarity.

In my view, that would be safer than what we have now.

	Steffen

^ permalink raw reply

* Re: remote#branch
From: Andreas Ericsson @ 2007-10-31  7:09 UTC (permalink / raw)
  To: Jeff King; +Cc: Jakub Narebski, git
In-Reply-To: <20071031015708.GA24403@coredump.intra.peff.net>

Jeff King wrote:
> On Wed, Oct 31, 2007 at 02:49:16AM +0100, Jakub Narebski wrote:
> 
>>> ...which is a quoting mechanism, and it's not even one commonly used in
>>> emails (i.e., people have written "parse a URL from this text" scripts
>>> for RFC-encoded URLs, but _not_ for shell quoting).
>> I don't think RFC-encoding is quoting mechanism used in emails, either.
> 
> That's funny, because I have hundreds of mails where that is the case,
> and none where people used shell-quoting.  Most URLs don't _need_ any
> encoding, so we don't notice either way. But are you honestly telling me
> that if you needed to communicate a URL with a space via email, you
> would write:
> 
>   'http://foo.tld/url with a space'
> 
> rather than:
> 
>   http://foo.tld/url+with+a+space
> 
> ?
> 

I think 99% of all URL's communicated via email are copy-pasted from a
webbrowsers location bar. I believe most git urls (or grls, or whatever
you wanna call them) communicated via email are copy-pasted from ones
config, or written out manually.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply

* Re: remote#branch
From: David Kastrup @ 2007-10-31  6:42 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <fg8h9l$b4n$1@ger.gmane.org>

Jakub Narebski <jnareb@gmail.com> writes:

> Jeff King wrote:
>
>> On Tue, Oct 30, 2007 at 12:38:27PM -0700, Linus Torvalds wrote:
>> 
>>   http://host/git repo with spaces in the path
>> 
>> compared to:
>> 
>>   http://host/git+repo+with+spaces+in+the+path
>> 
>> I don't know if that's worth changing anything in git (in fact, I'm not
>> even clear on _what_ people want to change; the point of this discussion
>> seems to be to argue about terminology). But you did ask for any reason
>> for quoting URLs.
>
> You use
>
>   'http://host/git repo with spaces in the path'

I can click on links in my mail reader, and the above is not recognized
as one.  <URL:http://host/git repo with spaces in the path> would likely
work.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply

* Re: remote#branch
From: David Kastrup @ 2007-10-31  6:39 UTC (permalink / raw)
  To: Jeff King
  Cc: Linus Torvalds, Pascal Obry, Matthieu Moy, Tom Prince,
	Theodore Tso, Junio C Hamano, Jan Hudec, Johannes Schindelin,
	Petr Baudis, Paolo Ciarrocchi, git
In-Reply-To: <20071030235823.GA22747@coredump.intra.peff.net>

Jeff King <peff@peff.net> writes:

> On Tue, Oct 30, 2007 at 12:38:27PM -0700, Linus Torvalds wrote:
>
>> So if you want to follow the RFC, you'd better give a real reason. And no, 
>> the existence of an RFC, and the fact that people use the same name for 
>> things that superficially _look_ the same is not a reason in itself.
>> 
>> So hands up, people. Anybody who asked for RFC quoting. Give a damn 
>> *reason* already!
>
> I didn't ask for RFC quoting, but a nice side effect of URL syntax is
> that they are machine parseable. If you wanted to write a tool to pick
> the URLs out of this email and clone them as git repos, then how do you
> find the end of:
>
>   http://host/git repo with spaces in the path
>
> compared to:
>
>   http://host/git+repo+with+spaces+in+the+path

You just write <URL:http://host/git repo with spaces in the path> and
have a good chance it will work.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply

* Re: git-svn and auto crlf convertion.
From: Eric Wong @ 2007-10-31  6:30 UTC (permalink / raw)
  To: Alexander Litvinov; +Cc: git
In-Reply-To: <200710311049.43861.litvinov2004@gmail.com>

Alexander Litvinov <litvinov2004@gmail.com> wrote:
> Hello.
> 
> I have private svn repo with cpp source file in windows encoding (\r\n line 
> ending). I am tring to import it into git using git-svn. To make correct crlf 
> convertion I have made git svn init first then create 
> correct .git/info/attributes file and import repo using git svn fetch 
> command. But after import done I have strange situation: after git 
> checkout -f master git status show that almost all text files are modified.
> 
> As I understand situation git-svn put \r\n encoded files into repo without 
> convertng them to \n notation. git-checkout,git-status does the job right and 
> found 'modification' as far as they do the needed convertion.

Disclaimer: I'm not yet familiar with git attributes, having never used them.

> Is there any way to configure git-svn to make proper convertion or it is 
> broken and need to be fixed ?

As far as I can tell, SVN itself will store files with either LF or CRLF
in the repository when the file is created/updated and applies the line
conversion properties only to the working tree upon checkout.  This
means that the SVN repository can have a file that's LF but only
converted to CRLF when checked out and vice-versa.

git-svn takes and imports whatever raw data SVN gives it, ignoring any
properties set in SVN.  This is very important because SVN transfers
deltas for updating files, and if we change the base file; we can't
apply the delta SVN gives us.

If we converted the newlines in the raw data that SVN gave us, we would
need to store what format the original data we got from SVN was in
because of the delta.

What I assume svn does is it either:

a) reconverts before doing `svn update' or `svn switch'
b) it ignores newline-only changes when running `svn status' or `svn diff'

git (as far as I know, and hope) does neither.

-- 
Eric Wong

^ permalink raw reply

* Re: [PATCH 1/1] Add --first-parent support to interactive rebase.
From: Björn Steinbrink @ 2007-10-31  5:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes.Schindelin, git
In-Reply-To: <7vodefj2lk.fsf@gitster.siamese.dyndns.org>

On 2007.10.30 22:05:27 -0700, Junio C Hamano wrote:
> Your MUA seems to mark the UTF-8 message you are sending out as
> 8859-1, which means your name in the message gets corrupt.

Hm, that would be git-send-email then, anything I need to configure?
(Actually I don't see it marking the message as anything)

> Björn Steinbrink <B.Steinbrink@gmx.de> writes:
> 
> > By default, rebase will take all commits from the branch that is to be
> > rebased which are missing in upstream. The new --first-parent option
> > allows to just follow the first parent and thus completely ignore
> > merges.
> >
> > Additionally, when used together with --preserve-merges (which is the
> > more useful use-case) it will no longer rebase the commits from the
> > merged-in branches, but instead redo the merge with the original
> > parents.
> >
> > That means that:

Given this situation:

> >      ---H------I topicB
> >     /    \      \
> > ...
> > does no longer become:

Which results in:

> >                 -H'--------I'
> >                /  \         \
> >               D'---E'---F'---G' topicA
> >              /
> >     A---B---C master
> >      \
> >       H---I topicB

When you do "git-rebase -p -i master topicA"

You can now also get:

> >     A---B---C master
> > ...
> >         ---------H---------I topicB

When you do "git-rebase -p -i --first-parent master topicA"


That's better, right?

> And crucially, you forgot to say "... when you do X".
> 
> I am assuming that you meant:
> 
>     This (picture) becomes this (picture) instead of this (picture)
>     when you run "git rebase -p -m master topicA".
> 
> but without it, the nice ASCII drawings loses their value.

:-/

> It is somewhat disturbing that this treats the first parent too
> special.

The original use-case for the "-p -i --first-parent" case was a question
on #git, where someone had sth. like this:

   o---o---o---o---o remote/branch
        \           \
     o---o---o---o---o topicA
    /
   o---o---o master trunk

Now that guy was using git-svn to dcommit into svn from master. To
dcommit the changes from topicA he had to have that based on master, and
he wanted to preserve the merges from remote/branch to have them
squashed when dcommitted to svn. So what he wanted was:


     ...---o---o---o---o---o remote/branch
                \           \
             o---o---o---o---o topicA
            /
   o---o---o master trunk

The default behaviour of rebase would totally flat out the history and
instead of two sqaush merges (which he wanted), svn would've seen a huge
amount of commits comning from remote/branch. And the plain -p behaviour
would have duplicated all those branches from remote/branch for no good
reason, so I came up with that --first-parent thing.

Better ideas are welcome, I just don't know git well enough to come up
with anything better...

Thanks,
Björn

^ 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