* Stgit and refresh-temp
From: Jon Smirl @ 2008-11-04 13:37 UTC (permalink / raw)
To: Karl Hasselström, Catalin Marinas, Git Mailing List
I hit a case when refreshing a buried patch that needed a merge
conflict sorted out.
I'm unable to recover out of the state.
jonsmirl@terra:~/fs$ stg status
A drivers/input/ir/ir-configfs.c
A drivers/input/ir/ir-core.c
A drivers/input/ir/ir.h
C drivers/input/ir/Makefile
D drivers/input/ir-configfs.c
D drivers/input/ir-core.c
D drivers/input/ir.h
M drivers/input/Makefile
M drivers/input/input.c
jonsmirl@terra:~/fs$ gedit drivers/input/Makefile drivers/input/input.c
jonsmirl@terra:~/fs$ gedit drivers/input/ir/Makefile
jonsmirl@terra:~/fs$ stg resolve drivers/input/ir/Makefile
jonsmirl@terra:~/fs$ stg help
usage: stg <command> [options]
Generic commands:
help print the detailed command usage
version display version information
copyright display copyright information
Repository commands:
clone Make a local clone of a remote repository
id Print the git hash value of a StGit reference
Stack (branch) commands:
branch Branch operations: switch, list, create, rename, delete, ...
clean Delete the empty patches in the series
coalesce Coalesce two or more patches into one
commit Permanently store the applied patches into the stack base
float Push patches to the top, even if applied
goto Push or pop patches to the given one
hide Hide a patch in the series
init Initialise the current branch for use with StGIT
log Display the patch changelog
patches Show the applied patches modifying a file
pop Pop one or more patches from the stack
pull Pull changes from a remote repository
push Push one or more patches onto the stack
rebase Move the stack base to another point in history
redo Undo the last undo operation
repair Fix StGit metadata if branch was modified with git commands
reset Reset the patch stack to an earlier state
series Print the patch series
sink Send patches deeper down the stack
top Print the name of the top patch
uncommit Turn regular git commits into StGit patches
undo Undo the last operation
unhide Unhide a hidden patch
Patch commands:
delete Delete patches
edit edit a patch description or diff
export Export patches to a directory
files Show the files modified by a patch (or the current patch)
fold Integrate a GNU diff patch into the current patch
import Import a GNU diff file as a new patch
mail Send a patch or series of patches by e-mail
new Create a new, empty patch
pick Import a patch from a different branch or a commit object
refresh Generate a new commit for the current patch
rename Rename a patch
show Show the commit corresponding to a patch
sync Synchronise patches with a branch or a series
Index/worktree commands:
diff Show the tree diff
resolved Mark a file conflict as solved
status Show the tree status
jonsmirl@terra:~/fs$ stg help coalesce
jonsmirl@terra:~/fs$ stg series
+ Makefile
+ anton_1
+ anton_3
+ add-of_find_i2c_device_by_node
+ jds_platform
+ max9485
+ jds-soc-machine
+ jds-psc-c
+ soc-u32-cleanup
+ jds-audio
+ g_spi_4
+ m_1
+ spi-mmc
+ mpc5200-rtc
+ lirc
+ jds-lirc
> refresh-temp
- jds-lirc-gpt
- jds-lirc-device-tree
- jds-lirc-mce2
jonsmirl@terra:~/fs$ ls
arch Documentation init MAINTAINERS net
samples usr vmlinux.strip.gz
block drivers ipc Makefile patches-master scripts virt
COPYING firmware Kbuild mm patches-save
security vmlinux
CREDITS fs kernel modules.order README sound
vmlinux.bin.gz
crypto include lib Module.symvers REPORTING-BUGS
System.map vmlinux.o
jonsmirl@terra:~/fs$ mv patches-master patches-foo
jonsmirl@terra:~/fs$ stg export
Checking for changes in the working directory ... done
Warning: Local changes in the tree; you might want to commit them first
jonsmirl@terra:~/fs$ stg status
A drivers/input/ir/ir-configfs.c
A drivers/input/ir/ir-core.c
A drivers/input/ir/ir.h
D drivers/input/ir-configfs.c
D drivers/input/ir-core.c
D drivers/input/ir.h
M drivers/input/Makefile
M drivers/input/input.c
M drivers/input/ir/Makefile
jonsmirl@terra:~/fs$ ls patches-master
add-of_find_i2c_device_by_node g_spi_4 jds_platform lirc
max9485 series
anton_1 jds-audio jds-psc-c m_1
mpc5200-rtc soc-u32-cleanup
anton_3 jds-lirc jds-soc-machine Makefile
refresh-temp spi-mmc
jonsmirl@terra:~/fs$ vi patches-master/refresh-temp
jonsmirl@terra:~/fs$ stg series
+ Makefile
+ anton_1
+ anton_3
+ add-of_find_i2c_device_by_node
+ jds_platform
+ max9485
+ jds-soc-machine
+ jds-psc-c
+ soc-u32-cleanup
+ jds-audio
+ g_spi_4
+ m_1
+ spi-mmc
+ mpc5200-rtc
+ lirc
+ jds-lirc
> refresh-temp
- jds-lirc-gpt
- jds-lirc-device-tree
- jds-lirc-mce2
jonsmirl@terra:~/fs$ stg refresh -p jds-lirc
Error: HEAD and top are not the same.
This can happen if you modify a branch with git.
"stg repair --help" explains more about what to do next.
stg refresh: Command aborted (all changes rolled back)
jonsmirl@terra:~/fs$ stg refresh
Error: HEAD and top are not the same.
This can happen if you modify a branch with git.
"stg repair --help" explains more about what to do next.
stg refresh: Command aborted (all changes rolled back)
jonsmirl@terra:~/fs$ stg new foo
Invoking the editor: "vi .stgit-new.txt" ... done
Error: HEAD and top are not the same.
This can happen if you modify a branch with git.
"stg repair --help" explains more about what to do next.
stg new: Command aborted (all changes rolled back)
jonsmirl@terra:~/fs$ stg new foo
Invoking the editor: "vi .stgit-new.txt" ... done
Error: HEAD and top are not the same.
This can happen if you modify a branch with git.
"stg repair --help" explains more about what to do next.
stg new: Command aborted (all changes rolled back)
jonsmirl@terra:~/fs$ stg repair --help
Usage: stg repair
Fix StGit metadata if branch was modified with git commands
Options:
-h, --help show this help message and exit
jonsmirl@terra:~/fs$
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* More help needed on merging unrelated repos
From: Christian MICHON @ 2008-11-04 13:14 UTC (permalink / raw)
To: Git Mailing List
Hi,
I previously posted here a question on how to merge unrelated repos,
and I was quite happy with the answer.
git pull repo_name repo_branch
Yet, when I merge these repos (they're unrelated), I'd like to merge
all of them at once.
How do I pull for example 2 repos in 1 command ? I cannot figure out
the exact syntax to use.
I tried:
git pull ../i1 0.5 ../i2 master
git pull ../i1 0.5 -- ../i2 master
I also tried to play with --no-commit and -s to no avail.
Does anyone of you already use this and knows the trick ? Thanks in advance!
--
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !
^ permalink raw reply
* RE: CRLF support bugs (was: Re: .gitattributes glob matchingbroken)
From: Kelly F. Hickel @ 2008-11-04 12:37 UTC (permalink / raw)
To: Jeff King, Hannu Koivisto; +Cc: git
In-Reply-To: <20081104051432.GD31276@coredump.intra.peff.net>
> -----Original Message-----
> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On
> Behalf Of Jeff King
> Sent: Monday, November 03, 2008 11:15 PM
> To: Hannu Koivisto
> Cc: git@vger.kernel.org
> Subject: Re: CRLF support bugs (was: Re: .gitattributes glob
> matchingbroken)
>
> On Mon, Nov 03, 2008 at 05:05:24PM +0200, Hannu Koivisto wrote:
>
<snip>
> > I think CRLF conversion support should have some attribute (be it
> > .gitattributes attribute or something else) that is somehow
> > inherited from the parent repository. It would basically say that
> > "you should use platform's native line end type for text files with
> > this repository and its children". To go with that, one would
> > maybe have a configuration option to tell what that platform
> > default line end type is (just in case someone wants to pretend
> > Cygwin is Unix or something like that).
>
> I think others have complained before about something like this, in
> that
> it really is a _local_ decision and not a _project_ decision to make. I
> am fortunate enough to work exclusively on platforms with sane line
> endings, so I don't know what is normal.
From my point of view, the factoid that a particular file should be subjected to having its line endings munged is a _project_ decision. Whether or not to munge them on any given platform is a _local_ decision.
I work on various UNIXes, Linux, Windows, z/OS, etc, etc, and I want the tool to just do the right thing so that I don't have to think about it on a daily basis.
My $0.02....
-Kelly
>
> But if you really wanted to do such a thing for some set of corporate
> users, maybe it would make sense to have a "clone" hook that runs after
> init and can set up any relevant config (e.g., by copying certain
> config
> values from the parent repo).
>
> -Peff
^ permalink raw reply
* RE: why not TortoiseGit
From: Johannes Schindelin @ 2008-11-04 12:52 UTC (permalink / raw)
To: Li Frank; +Cc: Nigel Magnay, Scott Chacon, Andreas Ericsson, Ian Hilt, git
In-Reply-To: <7FD1F85C96D70C4A89DA1DF7667EAE961E75EA@zch01exm23.fsl.freescale.net>
Hi,
On Tue, 4 Nov 2008, Li Frank wrote:
> TortoriseGIt should be in windows platform only because it is extension
> of explore.
FYI I completely disagree with this reasoning.
Ciao,
Dscho
^ permalink raw reply
* [PATCH 3/3] tag: Add more tests about mixing incompatible modes and options
From: Samuel Tardieu @ 2008-11-04 12:42 UTC (permalink / raw)
To: git
In-Reply-To: <20081104124207.18273.31679.stgit@arrakis.enst.fr>
Signed-Off-By: Samuel Tardieu <sam@rfc1149.net>
---
t/t7004-tag.sh | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index f0edbf1..f377fea 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1090,4 +1090,15 @@ test_expect_success 'filename for the message is relative to cwd' '
git cat-file tag tag-from-subdir-2 | grep "in sub directory"
'
+# mixing modes and options:
+
+test_expect_success 'mixing incompatibles modes and options is forbidden' '
+ test_must_fail git tag -a
+ test_must_fail git tag -l -v
+ test_must_fail git tag -n 100
+ test_must_fail git tag -l -m msg
+ test_must_fail git tag -l -F some file
+ test_must_fail git tag -v -s
+'
+
test_done
^ permalink raw reply related
* [PATCH 2/3] tag: Check that options are only allowed in the appropriate mode
From: Samuel Tardieu @ 2008-11-04 12:42 UTC (permalink / raw)
To: git
In-Reply-To: <20081104124207.18273.31679.stgit@arrakis.enst.fr>
"git tag" should not silently accept unrecognized options when operating
in a given mode. For example, "git tag -n 100", which may be a typo for
"git tag -n100", should not silently create a tag named "100".
Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
---
builtin-tag.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/builtin-tag.c b/builtin-tag.c
index 5ce0e21..d339971 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -344,7 +344,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
const char *object_ref, *tag;
struct ref_lock *lock;
- int annotate = 0, sign = 0, force = 0, lines = 0,
+ int annotate = 0, sign = 0, force = 0, lines = -1,
list = 0, delete = 0, verify = 0;
const char *msgfile = NULL, *keyid = NULL;
struct msg_arg msg = { 0, STRBUF_INIT };
@@ -383,10 +383,16 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
if (argc == 0 && !(delete || verify))
list = 1;
+ if ((annotate || msg.given || msgfile || force) &&
+ (list || delete || verify))
+ usage_with_options(git_tag_usage, options);
+
if (list + delete + verify > 1)
usage_with_options(git_tag_usage, options);
if (list)
- return list_tags(argv[0], lines);
+ return list_tags(argv[0], lines == -1 ? 0 : lines);
+ if (lines != -1)
+ die("-n option is only allowed with -l.");
if (delete)
return for_each_tag_name(argv, delete_tag);
if (verify)
^ permalink raw reply related
* [PATCH 1/3] tag: Do not allow to call "git tag" in more than one operating mode
From: Samuel Tardieu @ 2008-11-04 12:42 UTC (permalink / raw)
To: git
If "git tag -d -l -v ..." is called, only "-l" is honored, which is
arbitrary and wrong.
This patch checks that "git tag" knows in what mode it operates before
performing any operation.
Signed-Off-By: Samuel Tardieu <sam@rfc1149.net>
---
builtin-tag.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/builtin-tag.c b/builtin-tag.c
index 84db156..5ce0e21 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -380,7 +380,11 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
}
if (sign)
annotate = 1;
+ if (argc == 0 && !(delete || verify))
+ list = 1;
+ if (list + delete + verify > 1)
+ usage_with_options(git_tag_usage, options);
if (list)
return list_tags(argv[0], lines);
if (delete)
@@ -406,11 +410,6 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
}
}
- if (argc == 0) {
- if (annotate)
- usage_with_options(git_tag_usage, options);
- return list_tags(NULL, lines);
- }
tag = argv[0];
object_ref = argc == 2 ? argv[1] : "HEAD";
^ permalink raw reply related
* Re: Git SVN Rebranching Issue
From: Matt Kern @ 2008-11-04 11:24 UTC (permalink / raw)
To: Dmitry Potapov; +Cc: Eric Wong, git
In-Reply-To: <20081104094224.GC24100@dpotapov.dyndns.org>
> > It was actually an intentional design decision on my part preserve
> > parents based on branch name. We would eventually otherwise lose
> > history of the now-deleted branches, as reflogs can expire.
>
> Would it not be better to save the old branch using "@SVN-NUMBER" as
> suffix? Thus, those do not need the old branch can easily delete it.
I would second this approach.
Our svn repository isn't particularly big or old, but if someone were to
make a branch now, there is a fair chance it will have the same name as
an old branch but have absolutely nothing to do with that old branch.
The situation will only get worse as our svn repository grows and more
branches are created/deleted.
Matt
--
Matt Kern
http://www.undue.org/
^ permalink raw reply
* Re: Fetch via http and proxy which requires authentication
From: Paolo Ciarrocchi @ 2008-11-04 11:13 UTC (permalink / raw)
To: Dilip M; +Cc: Git Mailing List
In-Reply-To: <c94f8e120811030602p57007278p5a2c48ce7663282d@mail.gmail.com>
On Mon, Nov 3, 2008 at 3:02 PM, Dilip M <dilipm79@gmail.com> wrote:
> On Thu, Aug 28, 2008 at 3:43 PM, Paolo Ciarrocchi
> <paolo.ciarrocchi@gmail.com> wrote:
>>> Hi all,
>>> i'm looking for a way to use git behind a corporate proxy which
>>> requires authentication.
>>> i just need to be able to fetch/pull via http.
>>> i'm using git on a win xp box.
>>> Any hint?
>>
>> Yes, google for http_proxy ;-)
>>
>> export http_proxy=http://host:port
>> git clone http://username:password@giturl
>
> I tried setting, export http_proxy=http://<user>:<password>@host:port
>
> But git clone failed!
>
> $git clone http://kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git git
> clone http://kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
> Initialized empty Git repository in /home/dilipm/bin/linux-2.6/.git/
> fatal:
> http://kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/info/refs
> download error - The requested file was not found
>
> What may the problem? How can debug....
Works for me:
$ git version
git version 1.6.0.2.1172.ga5ed0
I set in the Environment Variables panel:
Variable Value
http_proxy http://ip_of_my_proxy
Regards,
--
Paolo
http://paolo.ciarrocchi.googlepages.com/
^ permalink raw reply
* Re: Intensive rename detection
From: Björn Steinbrink @ 2008-11-04 10:47 UTC (permalink / raw)
To: Andrew Arnott; +Cc: Jeff King, Junio C Hamano, Linus Torvalds, git
In-Reply-To: <216e54900811032236l5ae4bde5v16ab6519962e428f@mail.gmail.com>
On 2008.11.03 22:36:42 -0800, Andrew Arnott wrote:
> On Mon, Nov 3, 2008 at 10:16 PM, Jeff King <peff@peff.net> wrote:
> > On Mon, Nov 03, 2008 at 10:02:37PM -0800, Andrew Arnott wrote:
> >
> >> Hmmm.... actually on second run I am still getting the too many files
> >> warning. I put the [diff] section in a ~/.gitconfig file, a
> >> .gitconfig file in the root of my repo, and in the .git/config file,
> >> but none of them seem to get rid of the message.
> >
> > Where are you getting the warning? On "git status"?
> >
> > If so, then this is an instance of the problem I mentioned here:
> >
> > [PATCH v3 7/8] wt-status: load diff ui config
> > 20081026044935.GG21047@coredump.intra.peff.net
>
> Yes, on git status. I'm afraid I don't know how to look up the
> reference you gave.
http://marc.info/?l=git&m=122499658810367&w=2
Björn
^ permalink raw reply
* Re: Git SVN Rebranching Issue
From: Sverre Rabbelier @ 2008-11-04 10:15 UTC (permalink / raw)
To: Dmitry Potapov; +Cc: Eric Wong, Matt Kern, git
In-Reply-To: <20081104094224.GC24100@dpotapov.dyndns.org>
On Tue, Nov 4, 2008 at 10:42, Dmitry Potapov <dpotapov@gmail.com> wrote:
> On Tue, Nov 04, 2008 at 12:41:11AM -0800, Eric Wong wrote:
>> Short answer: you can use grafts to remove parents.
>
> Using grafts requires some cautious, especially when it is used to make
> some commits unreachable, because git gc can remove unreachable commits.
> Also, a repository with grafts cannot be cloned. So using grafts looks
> like more as workaround rather a real solution
I think what was meants is to use grafts and then make them permanent
with 'git filter-branch'.
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: locate commit by file
From: Jakub Narebski @ 2008-11-04 9:57 UTC (permalink / raw)
To: Ittay Dror; +Cc: Git Mailing List
In-Reply-To: <491003BC.7040206@gmail.com>
Ittay Dror <ittay.dror@gmail.com> writes:
> Given a file, is there an easy way (e.g., not bisecting) to find the
> latest commit where the file content is the same?
>
> Meaning: I have a file /tmp/A and I want to file the latest commit
> where a/b/A is identical (content wise) to /tmp/A.
Do you mean: find the commit which changed file to current version?
I think that
$ git rev-parse -1 -- file
Would work (but better check "git log -- file").
If you want to find which version corresponds to given contents, you
would have to find sha-1 of /tmp/A (using "git hash-object"), and
find it in difftree searching for sha ("git log --raw -- file", or
just "git log --raw" if you are not sure about name).
I think you can fins such script in mailing list archives...
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply
* Re: Git SVN Rebranching Issue
From: Dmitry Potapov @ 2008-11-04 9:42 UTC (permalink / raw)
To: Eric Wong; +Cc: Matt Kern, git
In-Reply-To: <20081104084111.GB14405@untitled>
On Tue, Nov 04, 2008 at 12:41:11AM -0800, Eric Wong wrote:
>
> Short answer: you can use grafts to remove parents.
Using grafts requires some cautious, especially when it is used to make
some commits unreachable, because git gc can remove unreachable commits.
Also, a repository with grafts cannot be cloned. So using grafts looks
like more as workaround rather a real solution.
>
> It was actually an intentional design decision on my part preserve
> parents based on branch name. We would eventually otherwise lose
> history of the now-deleted branches, as reflogs can expire.
Would it not be better to save the old branch using "@SVN-NUMBER" as
suffix? Thus, those do not need the old branch can easily delete it.
Dmitry
^ permalink raw reply
* Re: [PATCH] Documentation: add a planning document for the next CLI revamp
From: Dmitry Potapov @ 2008-11-04 9:18 UTC (permalink / raw)
To: Sam Vilain
Cc: Junio C Hamano, Jeff King, Sam Vilain, git, Johannes Schindelin,
Scott Chacon, Tom Preston-Werner, J.H., Christian Couder,
Kai Blin
In-Reply-To: <1225691960.20883.41.camel@maia.lan>
On Mon, Nov 03, 2008 at 06:59:20PM +1300, Sam Vilain wrote:
>
> I can see that some people want this behaviour by default; but to me
> "push the current branch back to where it came from" seems like far more
> a rational default for at least 90% of users.
I think it depends on one's workflow. If you use a centralized workflow
as with CVS then yes, 90% cases you want to push the current branch. On
the other hand, if people push their changes to the server only for
review, it means that accidentally pushing more than one intended is not
a big deal. The only one who does publishing to the official repository
is the maintainer, and the maintainer is most likely to run some tests
after merging all changes, which takes some time. So, it is rarely push
the current branch, it is usually the branch that has been tested, so
the name of the branch should be specified explicitly anyway.
Dmitry
^ permalink raw reply
* Re: [PATCH] push: fix local refs update if already up-to-date
From: Clemens Buchacher @ 2008-11-04 9:05 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, git
In-Reply-To: <7v7i7jsx6a.fsf@gitster.siamese.dyndns.org>
On Tue, Nov 04, 2008 at 12:38:37AM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > Though I am not happy that we have to look up the tracking ref for every
> > uptodate ref. I think it shouldn't be a big performance problem with
> > packed refs, though, since they are cached (i.e., we pay only to compare
> > the hashes, not touch the filesystem for each ref).
>
> It is either (1) the user pays the cost of finding what remote tracking
> branch we are mirroring when you push for all up-to-date refs, like you
> did in your "here is an improvement" patch; or (2) the user pays the cost
> of fetching from there, immediately after pushing. I'd imagine that the
> cost to do (1) would be smaller than (2). The question is if seeing stale
> tracking branches is such a big deal, as next "git fetch" from there will
> update them anyway. If it is a big deal, (1) would be a price worth
> paying.
Right. I think it is a big deal. I found out about this bug, because a user
on #git was confused by the fact that push reported "Everything up-to-date",
even though there were changes. A fetch fixed that, of course. But it is
confusing and inconsistent with normal push behavior. So I really think it's
worth a small performance hit.
> Clemens, care to reroll the patch?
I will do so later today.
^ permalink raw reply
* Re: [PATCH] push: fix local refs update if already up-to-date
From: Clemens Buchacher @ 2008-11-04 8:56 UTC (permalink / raw)
To: Jeff King; +Cc: git, Junio C Hamano
In-Reply-To: <20081104042643.GA31276@coredump.intra.peff.net>
On Mon, Nov 03, 2008 at 11:26:44PM -0500, Jeff King wrote:
> > The hashcpy for new_ref is now executed more often than absolutely
> > necessary. But this is not a critical path, right? So I decided to keep
> > things simple.
>
[...]
> Your patch makes ref->new_sha1 "valid" for every status case. Ordinarily
> I would be in favor of that, since it reduces coupling with other parts
> of the code (which have to know _which_ status flags provide a useful
> value in ->new_sha1). But in this case, I think the value we would be
> sticking in is not necessarily useful for every status flag we end up
> setting; so any consumers of the ref structure still need to know which
> flags set it. So even though it has a defined value, it is not really
> "valid" in all cases.
The other status flags are REF_STATUS_REJECT_NODELETE and
REF_STATUS_REJECT_NONFASTFORWARD. So in these cases the "new sha1" is going
to be the "old sha1". The default for new_sha1 is the null sha1. So while
the sha1 we're trying to push may not be more valid than the null sha1, it's
not less valid either, is it? And it even makes sense if you interpret
new_sha1 as the sha1 the client attempts to push.
> Hmm. I was hoping to see more in update_tracking_ref. With your patch,
> we end up calling update_ref for _every_ uptodate ref, which results in
> writing a new unpacked ref file for each one. And that _is_ a
> performance problem for people with large numbers of refs.
>
> So I think we need a check to make sure we aren't just updating with the
> same value. Something like:
I think update_ref already takes care of that. See this check in
write_ref_sha1:
if (!lock->force_write && !hashcmp(lock->old_sha1, sha1)) {
unlock_ref(lock);
return 0;
}
> Though I am not happy that we have to look up the tracking ref for every
> uptodate ref. I think it shouldn't be a big performance problem with
> packed refs, though, since they are cached (i.e., we pay only to compare
> the hashes, not touch the filesystem for each ref).
I don't think we can avoid that, though.
I agree with your other comments.
^ permalink raw reply
* Re: [Q] Abbreviated history graph?
From: Junio C Hamano @ 2008-11-04 8:45 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Brian Foster, Git Mailing List
In-Reply-To: <alpine.LFD.2.00.0811031211180.3419@nehalem.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> On Mon, 3 Nov 2008, Linus Torvalds wrote:
>>
>> I'll post a simple series of four commits in a moment.
> ...
> Side note: it's certainly possible that we could improve on this. Right
> now, "--simplify-namespace" will totally override any path simplification,
> so you can't get a combination of pathnames _and_ naming commits. I don't
> know exactly what the rules should be, but I could imagine that we could
> do something like:
>
> - if no pathnames are given, work the way the current patch-series works.
>
> - if path-names are given, make rev_compare_tree() truen
> REV_TREE_DIFFERENT if a name decoration _or_ a tree difference exists.
>
> Anyway, that's a fairly trivial extension to the idea, and doesn't really
> matter for the basic code. It can easily be left for later.
Thanks.
Including this (and the --source one), the series looks reasonable.
^ permalink raw reply
* git-p4: Importing multiple p4 prods into same git repo
From: dhruva @ 2008-11-04 8:42 UTC (permalink / raw)
To: Git
Hi,
I have the p4 layout as follows:
1. //depot/prod/devel/main
2. //depot/prod/devel/hacks
where #2 is a sort of fork of #1. There are lot of common objects
between them and #2 can trace its history to #1. I would like to
import both the above paths under the same git repository as 2 remote
branches so that they can share objects and reduce overall size. Is
this possible using 'git-p4'. I went through the code and got lost in
the complexities...
I urgently need this to consolidate multiple paths under the same git
folder and be able to serve them soon. Any help is greatly
appreciated.
-dhruva
--
Contents reflect my personal views only!
^ permalink raw reply
* Re: Git SVN Rebranching Issue
From: Eric Wong @ 2008-11-04 8:41 UTC (permalink / raw)
To: Matt Kern; +Cc: git
In-Reply-To: <20081103140746.GA5969@mars.cyantechnology.local>
Matt Kern <matt.kern@undue.org> wrote:
> I have a git-svn issue which keeps biting me.
>
> My company uses svn as its primary version control system. We
> frequently create branches, e.g. /branches/somebranch, by forking the
> trunk to ensure stability over the "somebranch" code. The problem is
> that we also frequently blow away /branches/somebranch and refork it
> from the trunk.
>
> git-svn does a good job for most work, but I notice that if you delete
> the "somebranch" branch in svn and then refork it, also in svn, then
> when you git-svn fetch, the git commit at the head of remotes/somebranch
> will have two parents: the first is the previous head of
> remotes/somebranch, and the second is the head of remotes/trunk. Surely
> only the remotes/trunk parent should be listed? Any connection with the
> previous remotes/somebranch is an accident of naming. The real problem
> then comes when you come to look at the history in gitk. If
> "somebranch" is rebranched many times, the git history starts looking
> pretty complicated, when in fact it should simply be the linear history
> of remotes/trunk up to the branch point followed by a few,
> branch-specific commits. Is there any way to prevent (or modify) the
> git history to remove the errant parent?
Hi Matt,
Short answer: you can use grafts to remove parents.
It was actually an intentional design decision on my part preserve
parents based on branch name. We would eventually otherwise lose
history of the now-deleted branches, as reflogs can expire.
To me, it's easier to drop history connections you don't want with
grafts than to recover it by refetching.
--
Eric Wong
^ permalink raw reply
* Re: [PATCH] push: fix local refs update if already up-to-date
From: Junio C Hamano @ 2008-11-04 8:38 UTC (permalink / raw)
To: Jeff King; +Cc: Clemens Buchacher, git
In-Reply-To: <20081104042643.GA31276@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Though I am not happy that we have to look up the tracking ref for every
> uptodate ref. I think it shouldn't be a big performance problem with
> packed refs, though, since they are cached (i.e., we pay only to compare
> the hashes, not touch the filesystem for each ref).
It is either (1) the user pays the cost of finding what remote tracking
branch we are mirroring when you push for all up-to-date refs, like you
did in your "here is an improvement" patch; or (2) the user pays the cost
of fetching from there, immediately after pushing. I'd imagine that the
cost to do (1) would be smaller than (2). The question is if seeing stale
tracking branches is such a big deal, as next "git fetch" from there will
update them anyway. If it is a big deal, (1) would be a price worth
paying.
In short, I agree with everything you said in your analysis. Thanks for
being a very good reviewer.
Clemens, care to reroll the patch?
^ permalink raw reply
* Re: libxdiff and patience diff
From: Pierre Habouzit @ 2008-11-04 8:33 UTC (permalink / raw)
To: Davide Libenzi; +Cc: Git ML
In-Reply-To: <Pine.LNX.4.64.0811031904130.9116@alien.or.mcafeemobile.com>
[-- Attachment #1: Type: text/plain, Size: 2593 bytes --]
On Tue, Nov 04, 2008 at 03:17:37AM +0000, Davide Libenzi wrote:
> On Tue, 4 Nov 2008, Pierre Habouzit wrote:
>
> > Hi Davide,
> >
> > I've been working tonight, trying to make libxdiff support the patience
> > diff algorithm, but I've totally failed, because I _thought_ I
> > understood what xdl_split was doing, but it appears I don't.
> >
> >
> > [ For the readers playing at home, the patience diff algorithm is
> > explained after my sig. ]
> >
> >
> > What I did is to:
> > (1) add a flag to the xenv in xdl_split that says that I want a
> > patience "split".
> > (2) Then in xdl_split, if that bit is set, I compute the longest common
> > subsequence from the patience diff.
> > (3) for each split it computes I call xdl_recs_cmp on that interval.
> >
> >
> > What I thought it would achieve is that I force some boundaries at which
> > libxdiff _must_ resync. Though, it seems that for some reason it doesn't
> > work, probably because the "ha" stuff and the boundaries absolutely
> > don't work the way I thought it did.
> >
> > So where is the place I should do that ? I suspect it should be
> > partly in xprepare.c but I'm a bit stuck right now.
> >
> >
> > Any pointer on how the stuff in xprepare.c and xdiffi.c work would help
> > greatly, it's really not self-evident to me :)
>
> What makes you think it'd self-evident to me? :)
> Seriously, I forgot stuff I wrote the last month, this is way beyond my
> memory limits.
> You definitely need to look at xprepare.c, especially at xdl_trim_ends()
> and xdl_cleanup_records(). Lines are re-arranged in indexes, and this
> might screw up your logic if you're not prepared for it.
> What xdl_split() does, is find the start of an LCS and return the
> coordinate. Then xdl_recs_cmp() does the box reducing (first two "for"
> loops) and different-lines marking (first and second "if").
Well it's what I thought it did indeed, that's why before recursing into
that bit, I tried to extract a full LCS from the patience diff algorithm
and recurse into that for each interval it gives, which _should_ work,
but doesn't at all :/
Okay maybe I should re-read my algorithm slowly and check that I've not
made something silly (like chaining the list in the reverse order or god
knows what), but my debug functions let me believe that I did that fine.
I'll look into it tonight.
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: libxdiff and patience diff
From: Pierre Habouzit @ 2008-11-04 8:30 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: davidel, Git ML
In-Reply-To: <alpine.DEB.1.00.0811040627020.24407@pacific.mpi-cbg.de>
[-- Attachment #1: Type: text/plain, Size: 3639 bytes --]
On Tue, Nov 04, 2008 at 05:39:48AM +0000, Johannes Schindelin wrote:
> Hi,
>
> On Tue, 4 Nov 2008, Pierre Habouzit wrote:
>
> > I've been working tonight, trying to make libxdiff support the patience
> > diff algorithm, but I've totally failed, because I _thought_ I
> > understood what xdl_split was doing, but it appears I don't.
>
> I thought about it, too, at the GitTogether, although I want to finish my
> jGit diff first.
>
> The main idea I had about patience diff is that you can reuse a lot of
> functions in libxdiff.
>
> But the requirement of taking just unique lines/hashes into account, and
> _after_ splitting up, _again_ determine uniqueness _just_ in the
> between-hunk part made me think that it may be wiser to have a separate
> function for the patience diff stuff.
>
> Basically, you would start to have libxdiff split the lines and hash them
> as normal, but then determine the unique hashes (I'd start with the
> smaller text, just to have a better chance to end up with unique hashes).
>
> Once they are determined, you can search for those exact lines (hash
> first) in the post-document.
Actually my current implementation just puts all the hashes into an
array, sorts them by hash (which is O(n log(n)) with the position from
left or right file it's in, ordered by increasing right position. (and
the struct is filled with the left pos to -1 if the right pos is set,
and vice versa).
The I scan the array to find patterns of two consecutive hashes exactly,
and collapse it into the proper {left pos, right pos} tuple if it was
indeed a unique line in both files.
This results into an array I sort again by right pos then, and we can
work on that for the stack sorting, and I do it, and then I have my LCS.
This is the complete brute-force algorithm which requires a temporary
array of the size of the number of lines on the left + the right, and a
temporary array for the stacks which _may_ end up being as large as the
smallest number of lines between the left or right file in the worst
case I'd say (roughly).
Then I just remember a list of split points, and I recurse in all the
sub splits again. It has a fixed point which may or may not need
libxdiff recursion in it.
This code is actually written, naive and unoptimized but it doesn't work
probably because I didn't plug that in the proper place :)
> Once that is done, you'd have to find the longest common subsequence,
> which you could do using the existing infrastructure, but that would
> require more work (as we already know the lines are unique).
Patience diff gives you the algorithm to do that, it's pretty simple,
and is more efficient than the current infrastructure (in time, I don't
know for space though).
> After that, you would have to recurse to the same algorithm _between_
> known chunks. Eventually, that would have to resort to classical libxdiff
> (if there are no, or not enough, unique lines).
Yeah, that's the point, the problem is, I believe more and more that I
should prepare the LCS from patience diff in xprepare.c, but I grok
absolutely nothing at what the chastore_t and similar stuff is. I
understand it's about hashing, but the exact stuff it does eludes me. In
fact when I look at the records I have in xdiffi.c I had the impression
they were already somehow collapsed, which makes it a too late point to
apply the patience diff ...
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [RFC PATCH] git-svn: proper detection of bare repositories
From: Eric Wong @ 2008-11-04 8:30 UTC (permalink / raw)
To: Deskin Miller; +Cc: git
In-Reply-To: <20081103000903.GA1135@euler>
Deskin Miller <deskinm@umich.edu> wrote:
> I keep coming across commands like this, which don't work properly in bare
> repositories, and thinking that they need to be patched (see e.g. ddff8563, or
> Duy's comments on the thread starting at
> http://thread.gmane.org/gmane.comp.version-control.git/98849), but now I'm not
> so sure. For one, despite this patch working, it turns out that 'git --bare
> svn <cmd>' also works (and presumably has) for some time.
Interesting. I've never even looked at --bare myself. It always
should've worked if GIT_DIR= was explicitly set and I guess back in the
old days when I wrote git-svn, --bare wasn't even a flag :)
> Is git --bare the correct way to deal with this situation? That is to say, do
> we intend commands to 'just work' regardless of whether the repo is bare or
> not, or should the user be thinking about the difference and including --bare
> in the command invocation when necessary? I'm a vote for the 'just work' camp,
> but it seems a lot of things aren't necessarily that way. On the other hand,
> the majority of commands do just work.
>
> I guess I'm asking for a sanity check before I write any more such patches;
> certainly I find them useful, as the issues come up during my normal use of
> Git, but I don't want to be pursuing things of no use to anyone else, or
> (worse) things that are fundamentally wrong for some reason I don't understand
> yet.
I don't think there's anything fundamentally wrong with things 'just
working' on bare repos. It's just another case of something that not
many people end up using (especially for git-svn) and hence got fewer
testers and bug reports.
> -- 8< --
>
> When in a bare repository (or .git, for that matter), git-svn would fail
> to initialise properly, since git rev-parse --show-cdup would not output
> anything. However, git rev-parse --show-cdup actually returns an error
> code if it's really not in a git directory.
>
> Fix the issue by checking for an explicit error from git rev-parse, and
> setting $git_dir appropriately if instead it just does not output.
>
> Signed-off-by: Deskin Miller <deskinm@umich.edu>
> ---
> git-svn.perl | 14 ++++++++++----
> t/t9100-git-svn-basic.sh | 9 +++++++++
> 2 files changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/git-svn.perl b/git-svn.perl
> index 56238da..d25e9be 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -42,6 +42,7 @@ use File::Path qw/mkpath/;
> use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
> use IPC::Open3;
> use Git;
> +use Error qw/:try/;
>
> BEGIN {
> # import functions from Git into our packages, en masse
> @@ -214,11 +215,16 @@ unless ($cmd && $cmd =~ /(?:clone|init|multi-init)$/) {
> "but it is not a directory\n";
> }
> my $git_dir = delete $ENV{GIT_DIR};
> - chomp(my $cdup = command_oneline(qw/rev-parse --show-cdup/));
> - unless (length $cdup) {
> - die "Already at toplevel, but $git_dir ",
> - "not found '$cdup'\n";
> - }
> + my $cdup = undef;
> + try {
> + $cdup = command_oneline(qw/rev-parse --show-cdup/);
> + $git_dir = '.' unless ($cdup);
> + chomp $cdup if ($cdup);
> + $cdup = "." unless ($cdup && length $cdup);
> + }
> + catch Git::Error::Command with {
> + die "Already at toplevel, but $git_dir not found\n";
> + };
How about using git_cmd_try instead?
The Error.pm try/catch stuff makes me a bit uncomfortable. I realize
it's (unfortunately) in Git.pm; but I'd rather keep it confined there so
we can more easily remove it later if someone were inclined.
Otherwise I like the idea of this patch.
Thanks,
--
Eric Wong
^ permalink raw reply
* Re: [PATCH] git send-email: allow any rev-list option as an argument.
From: Pierre Habouzit @ 2008-11-04 8:19 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, git
In-Reply-To: <7vej1sti78.fsf@gitster.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 2254 bytes --]
On Tue, Nov 04, 2008 at 01:04:27AM +0000, Junio C Hamano wrote:
> Pierre Habouzit <madcoder@debian.org> writes:
>
> > As a summary, I'd say that I like both (1) and (3) because those are
> > handy, short, and either completely or mostly backward compatible. My
> > way would be to go down (1) and add a alias.s-e = !git send-email -F in
> > my .gitconfig.
> >
> > What do you think ?
>
> I wonder if we can do this even without an explicit -F.
>
> What command line arguments does send-email take, and what options would
> we want to give the underlying format-patch? Can't you sift them without
> ambiguity?
>
> The current syntax is:
>
> git send-email <flags>... <file|dir>...
>
> I am wondering if we can just extend it to:
>
> git send-email <flags>... <<file|dir>...|rev>
>
> E.g. we should be able to parse this out:
>
> git send-email --to git@vger.kernel.org -M --suppress-cc=all origin
>
> and notice "--to git@vger.kernel.org" and "--suppress-cc" are for
> send-email, guess "-M" (or anything that is outside the current
> send-email's vocabulary) is meant for format-patch, and if there is no
> file or directory called "origin" then decide that the user wants to run
> format-patch, and act as a front-end as if the user did:
>
> git format-patch -o tmp.$$ -M origin &&
> ... perhaps do your --annotate and --compose here by launching
> ... the editor...
> git send-email --to git@vger.kernel.org --suppress-cc=all tmp.$$ &&
> rm -fr tmp.$$
>
> If you happen to have a file or a directory called origin, it would be
> safer for users if the command errored out asking for disambiguation. The
> user can either say "./origin" or "origin^0" to disambiguate between them.
Oh right you can disambiguate references using ^0 so maybe my proposal
works after all, though it has to check for each file name if it's not a
reference _also_. I like it. I will rework my patch series now then,
since most of the discussed points of them have been addressed in the
thread.
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* locate commit by file
From: Ittay Dror @ 2008-11-04 8:11 UTC (permalink / raw)
To: Git Mailing List
Hi,
Given a file, is there an easy way (e.g., not bisectig) to find the
latest commit where the file content is the same?
Meaning: I have a file /tmp/A and I want to file the latest commit where
a/b/A is identical (content wise) to /tmp/A.
Thank you,
Ittay
--
--
Ittay Dror <ittay.dror@gmail.com>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox