git mailing list

FromSubjectsort iconDate
Miles Bader
way to automatically add untracked files?
One thing I often want to do is git-add all untracked files, and also automatically git-rm all "disappeared" files (I keep my .gitignore files well maintained, so the list of adding/missing files shown by git status is almost always correct). At the same time, I usually want to do "git add -u" to git-add modified files. One way to do this seems to be just "git add .", but I'm always slightly nervous using it because it sits there and churns the disk for an awful long time (whereas "git status" is ...
Aug 4, 11:31 pm 2007
Shawn O. Pearce
Re: way to automatically add untracked files?
That's the correct way to add those new files that aren't ignored. The problem is actually a small bug in git-add; we did not take the obvious performance optimization of skipping files that are stat clean in the index. So what is happening here during `git add .` is we are reading and hashing every single file, even if it is already tracked and is not modified. In short we're just working harder than we need to during this operation. I believe this has been fixed in git 1.5.3-rc3 or rc4. Not ...
Aug 4, 11:58 pm 2007
Miles Bader
git-diff new files (without using index)
One thing I often want to do is generate a complete diff of all changes, including new/removed files. If I add things to the index, I can use "git-diff --cached" to do it; however I'd actually like to be able to do this _without_ updating the index; in other words, any un-added new file as a change. As it is, the "non-indexed" state seems kind of a second-class citizen, as you can never have new files there (or rather, git will never really see them). Is there anyway to do this currently? If no...
Aug 4, 11:42 pm 2007
Shawn O. Pearce
Re: git-diff new files (without using index)
Use a temporary index: (export GIT_INDEX_FILE=.git/tempindex; cp .git/index $GIT_INDEX_FILE; git add new-file; git add other-new-file; git diff --cached) We pull this trick sometimes in internal tools, when we want to produce some result but aren't sure we want to keep the resulting index, or really know we don't want to keep the resulting index. Another option is to just add everything, then reset the index: git add new-file git add other-new-file git diff --cache...
Aug 4, 11:52 pm 2007
Jakub Narebski
Re: Some ideas for StGIT
> git-diff|git-apply --index.
Aug 4, 8:17 pm 2007
Shawn O. Pearce
Re: Some ideas for StGIT
> > git-diff|git-apply --index.
Aug 4, 10:31 pm 2007
Junio C Hamano
Re: Some ideas for StGIT
Minor factual correction. "am -3" uses merge-recursive *ONLY* when patch does not apply, so it is often the best of both worlds, as long as your changes do not involve renames. And that is what the default rebase uses. -
Aug 4, 11:32 pm 2007
Johannes Schindelin
[PATCH] checkout-index needs a working tree
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> --- This fixes "git --work-tree=/some/where/else checkout-index". git.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/git.c b/git.c index 25b8274..f8c4545 100644 --- a/git.c +++ b/git.c @@ -315,7 +315,8 @@ static void handle_internal_command(int argc, const char **argv) { "branch", cmd_branch, RUN_SETUP }, { "bundle", cmd_bundle }, { "cat-file", cmd_cat_file, RUN_SETUP }, - { "c...
Aug 4, 6:20 pm 2007
Junio C Hamano
Re: [PATCH] checkout-index needs a working tree
Hmmph. I was trying to come up with a better commit log message for this change. Paths given from the command line of checkout-index name files relative to the cwd, whose implication is that it is relative to where you are in relation with the top of the working tree. For doing that, you need to have the work tree to begin with. Does this mean that any command that uses its prefix parameter to cmd_xxx() needs NEED_WORK_TREE? I wonder if it would help us to catch similar breakages if we...
Aug 4, 6:50 pm 2007
Johannes Schindelin
Re: [PATCH] checkout-index needs a working tree
Hi, I tried that, but we have some places where we ask "if (prefix && *prefix)", for example in ls-tree. It does not _require_ a work tree, but it certainly uses it when it is available -- which is fine. Other users are more tricky, such as ls-files and update-index, which need a working tree only in some cases. I'll probably write a patch on Monday (if nobody else is faster) to provide a function "require_work_tree()" in environment.c, which does the obvious (with caching). T...
Aug 4, 9:33 pm 2007
david
possible bug in git apply?
since git doesn't track directories, only content (per the big discussion recently) I beleive that doing a checkout would leave Rob without the directories that he emptied out, so shouldn't git apply also clear the directories to end up in the same state? David Lang ---------- Forwarded message ---------- Date: Sat, 4 Aug 2007 15:19:54 -0400 From: Rob Landley <rob@landley.net> To: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Roland Dreier <rdreier@cisco.com>, Linux K...
Aug 4, 3:45 pm 2007
David Kastrup
Re: possible bug in git apply?
Yes, once he commits. As long as git keeps files tracked in that directory, there is no reason for it to delete it. I agree that it is hard to come up with a good logic for this sort of thing. git-add checks the _current_ state of a file into the index. git-rm can actually do the same only by actually _deleting_ the working copy. So when should git try deleting the directory? Probably when the directory becomes empty in the index, for consistency. Too bad that the index does not contain any...
Aug 4, 4:08 pm 2007
Junio C Hamano
Re: possible bug in git apply?
It should and it does, unless you have untracked files in that directory that you haven't told git about. Then removing the directory along with these files will lose the files there, which is a wrong thing to do. A simple "rm -fr this/directory/is/no/longer/interesting/to/me" would be all that is needed. -
Aug 4, 4:00 pm 2007
Nguyen Thai Ngoc Duy
gitbox status (for those who want to hack on it)
I would say it's in pretty good state now because it can run through test cases. Running tests on Windows can take about an hour so I'll put test results here so you don't have to rerun the whole thing if you want to know what part needs work. Known failed tests: t1301-shared-repo.sh: no umask on gitbox t3200-branch.sh: "unable to move logfile" and "Not a valid object name" t3405-rebase-malformed.sh: no idea t3900-i18n-commit.sh: failed due to diff not ignore \r. I don't really care about this. t...
Aug 4, 1:40 pm 2007
Mark Levedahl
rc4 - make quick-install-doc is broken
Beginning with commit 6490a3383f1d0d96c122069e510ef1af1d019fbb Fix work-tree related breakages install-doc-quick.sh no longer installs man pages, at least not to the defined $mandir (if "git-checkout-index" is putting them somewhere else, I haven't discovered where). Reverting the above commit eliminates this problem. This is on Cygwin, haven't tried on Linux. Mark Levedahl -
Aug 4, 11:07 am 2007
Johannes Schindelin
Re: rc4 - make quick-install-doc is broken
Hi, Could it be that you did not find this commit by bisecting the issue? I highly doubt that said commit changes anything in the build process. Ciao, Dscho -
Aug 4, 11:38 am 2007
Mark Levedahl
Re: rc4 - make quick-install-doc is broken
<snip ...> git>git bisect good 6490a3383f1d0d96c122069e510ef1af1d019fbb is first bad commit commit 6490a3383f1d0d96c122069e510ef1af1d019fbb Author: Junio C Hamano <gitster@pobox.com> Date: Thu Aug 2 15:10:56 2007 -0700 Fix work-tree related breakages In set_work_tree(), variable rel needs to be reinitialized to NULL on every call (it should not be static). Make sure the incoming dir variable is not too long before copying to the temporary buffer, and ma...
Aug 4, 12:00 pm 2007
rene.scharfe
Re: rc4 - make quick-install-doc is broken
I've started a bisect run myself and ended up at a different commit, viz. e90fdc39b6903502192b2dd11e5503cea721a1ad ("Clean up work-tree handling"). Hmm. I guess this candidate has a greater chance of actually being the culprit than yours. ;-) I can't offer a fix, but I think I've captured install-doc-quick.sh's problem in a test script (see below). It fails with e90fdc3 (and master) but succeeds with e90fdc3^. Apparently checkout-index (and ls-files, but this is not used by the install scri...
Aug 4, 4:19 pm 2007
Johannes Schindelin
Re: rc4 - make quick-install-doc is broken
Hi, It succeeds here... (without the patch I sent out, of course.) Ciao, Dscho -
Aug 4, 5:33 pm 2007
rene.scharfe
Re: rc4 - make quick-install-doc is broken
I assume you tested e90fdc3 and e90fdc3^; what about 4f8f03d (current HEAD)? Thanks, Ren
Aug 4, 6:09 pm 2007
Johannes Schindelin
Re: rc4 - make quick-install-doc is broken
Hi, your test script is slightly wrong... First you "git init", with GIT_DIR in $(pwd)/.git, i.e. the default. But then, you need not do this, test scripts are called when git init was already called. Then you make an untracked directory called untracked/. Tradition dictates that when we're in that directory, we get the prefix "untracked/", because we might add a file, or reference a file in another branch, where that directory is _not_ untracked. So it is expected that checkout-inde...
Aug 4, 6:37 pm 2007
rene.scharfe
Re: rc4 - make quick-install-doc is broken
The test is modelled after the install script; Documentation/ (the CWD OK, makes sense. Thanks, Ren
Aug 4, 7:03 pm 2007
Johannes Schindelin
Re: rc4 - make quick-install-doc is broken
Hi, I thought I tested on master + --new-workdir... But I did not. And indeed, it fails. Sorry, Dscho -
Aug 4, 6:25 pm 2007
Mark Levedahl Aug 4, 4:45 pm 2007
Johannes Schindelin
Re: rc4 - make quick-install-doc is broken
Hi, Thanks for doing this. I will work on this in a few minutes; at the moment I am occupied with msysGit... Ciao, Dscho -
Aug 4, 4:21 pm 2007
Johannes Schindelin
Re: rc4 - make quick-install-doc is broken
Hi, Could you please GIT_TRACE=1 make quick-install-doc ? It breaks here, too, but because I have no origin/man branch. Ciao, Dscho -
Aug 4, 12:04 pm 2007
Mark Levedahl
Re: rc4 - make quick-install-doc is broken
git>GIT_TRACE=1 make prefix=/usr quick-install-doc make -C Documentation quick-install make[1]: Entering directory `/usr/src/git/Documentation' make -C ../ GIT-VERSION-FILE make[2]: Entering directory `/usr/src/git' make[2]: `GIT-VERSION-FILE' is up to date. make[2]: Leaving directory `/usr/src/git' sh ./install-doc-quick.sh origin/man /usr/share/man trace: built-in: git 'rev-parse' '--git-dir' trace: built-in: git 'rev-parse' '--verify' 'origin/man^0' trace: built-in: git 'read-tree' 'origin/m...
Aug 4, 12:14 pm 2007
Johannes Schindelin
Re: rc4 - make quick-install-doc is broken
Hi, At this point, could you try debugging it? For example, set a break point in set_work_tree(), since that is the only function that commit touches, and see what it returns both before and after the bad commit? Ciao, Dscho -
Aug 4, 12:21 pm 2007
Mark Levedahl
Re: rc4 - make quick-install-doc is broken
Before the bad commit, set_work_tree returns (null), and variable dir_buffer in the call to get_relative_cwd is "/usr/src/git/.git/HEAD" After, it returns "Documentation/", and variable dir_buffer in the call to get_relative_cwd is "/usr/src/git" I do not understand what the desired changes in this patch were so am really lost as to what should be fixed. However, the above I hope will give you a good clue as to what is broken. Mark -
Aug 4, 1:56 pm 2007
Johannes Schindelin
[PATCH] Fix quick-install-doc
The recent work-tree cleanups exposed that the install-doc-quick script was relying on a strange behaviour predating the work-tree series: when setting a GIT_DIR, it was assumed that the current working directory is the root of the working tree. The recent work-tree series changed that behaviour: now that you can set the work tree explicitely, the work tree root defaults to $GIT_DIR/.. if $GIT_DIR has a /.git suffix when that is a parent directory of the current working directory. Noticed by M...
Aug 4, 5:32 pm 2007
rene.scharfe
Re: [PATCH] Fix quick-install-doc
That won't work if $mandir doesn't exist, which can happen if you install the manpages for the first time. Simply add a mkdir: (mkdir -p "$mandir" && cd "$mandir" && git checkout-index -a -f) Ren
Aug 4, 6:09 pm 2007
Mark Levedahl
Re: rc4 - make quick-install-doc is broken
Sorry - I hit send too fast on the previous mail. The relevant build lines are: GIT_INDEX_FILE=`pwd`/.quick-doc.index export GIT_INDEX_FILE rm -f "$GIT_INDEX_FILE" git read-tree $head git checkout-index -a -f --prefix="$mandir"/ After this commit, git checkout-index does not write the man files into $mandir, before this commit, it does. Mark Levedahl -
Aug 4, 12:08 pm 2007
Johannes Schindelin
Re: rc4 - make quick-install-doc is broken
Hi, Just to hazard a guess... you see an error message there, such as "cannot chdir to <blablabla>: No such file or directory"? It's kinda hard to debug this with incomplete information. Ciao, Dscho -
Aug 4, 12:16 pm 2007
Mark Levedahl
Re: rc4 - make quick-install-doc is broken
Nope - no error messages, nada. The trace output I sent you is absolutely uninformative as well. There is absolutely no visible difference between the version where this works (the previous commit) and the version where it does not, except that in the latter case the files are not written out (or at least not to where they should be written nor to any other place I can find. If you have any suggestions on how I can help debug this, I am more than willing but not at all familiar with the inter...
Aug 4, 12:27 pm 2007
Lars Hjemli
[PATCH] git-submodule: re-enable 'status' as the default sub...
This was broken as part of ecda072380. Signed-off-by: Lars Hjemli <hjemli@gmail.com> --- git-submodule.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 2cfeadd..3320998 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -313,7 +313,7 @@ case "$add,$init,$update,$status,$cached" in ,,1,,) modules_update "$@" ;; -,,,1,*) +,,,*,*) modules_list "$@" ;; *) -- 1.5.3.rc4-dirty -
Aug 4, 10:25 am 2007
Jakub Narebski
Re: Terminology question about remote branches.
[Cc: David Kastrup <dak@gnu.org>, git@vger.kernel.org] Or by using "git remote" command. -- Jakub Narebski Warsaw, Poland ShadeHawk on #git -
Aug 4, 8:14 am 2007
Dmitry Kakurin
[MinGW PATCH] 'git clone git://...' was failing inside git-r...
NOTE: This fix uses is_absolute_path from msysGit-0.3.exe that is not in mingw.git yet. Correctly test for absolute path This fix (while correct) actually avoids another nasty bug that must be fixed later: environment.c caches results of many getenv calls. Under MinGW setenv(X) invalidates all previous values returned by getenv(X) so cached values become dangling pointers. Signed-off-by: Dmitry Kakurin <Dmitry.Kakurin@gmail.com> --- setup.c | 2 +- 1 files changed, 1 insertions(+),...
Aug 4, 7:38 am 2007
Johannes Schindelin
Re: [MinGW PATCH] 'git clone git://...' was failing inside g...
Hi, Our coding style does not want them extra spaces... + if (!is_absolute_path(gitdirenv)) { is the way we prefer it. Ciao, Dscho -
Aug 4, 10:16 am 2007
David Kastrup
Terminology question about remote branches.
I am trying to dig through man-pages and user manual and trying to match them with reality. I seem to have a hard time. My current understanding (which definitely differs from the documented state) is that there are two types of branches, local and remote branches, and both types of branches can be remote-tracking (it may not be possible to have a non-remote-tracking remote branch, though). A local branch is one with a local branch head. In contrast, checking out a remote branch, while possibl...
Aug 4, 6:55 am 2007
Sean
Re: Terminology question about remote branches.
On Sat, 04 Aug 2007 12:55:43 +0200 To be clear, it's the job of git-fetch to update remote-tracking branches with any changes found in the remote repository. Git-pull runs git-fetch and then runs a git-merge to update the currently-checked-out branch. When this happens, git-merge must decide which remote-tracking-branch to merge into the currently checked out local branch. You can set which remote-tracking-branch will be selected in this situation with the --track option. So assuming a rem...
Aug 4, 9:29 am 2007
David Kastrup
Re: Terminology question about remote branches.
So --track does not set up a tracking branch, but makes a local _following_ branch _refer_ to a tracking branch. What happens with git checkout origin/branchX git branch --track mylocalbranch git checkout mylocalbranch ? What if after the checkout (which leads to a detached head) I check in a few things, and then decide to name the branch and set it up as following a remote tracking branch? Instead of using git-branch for setting up the following, do I have to explicitly add t...
Aug 4, 10:01 am 2007
Sean
Re: Terminology question about remote branches.
On Sat, 04 Aug 2007 16:01:55 +0200 Sure, that's one way to describe it; perhaps it would be best if This is easy to test, and the answer is that no tracking is set up. You must supply the remote-tracking-branch on the command line with the --track option to git branch. Actually I realized that with a It's not a problem, you could just add an appropriate [branch...] section in your .git/config. Actually looking at a typical branch section is even more confusing to me: $ git branch fudg...
Aug 4, 10:48 am 2007
David Kastrup
Re: Terminology question about remote branches.
Not according to my current understanding, but that can, of course, change again in the next few hours. As far as I understand right now, such a branch indeed tracks a remote branch (and not a remote tracking branch), it just does not track it recklessly: it has a head of its Yes, it seems --track does track after all. Just more cautiously than Good. It means that I may not be a complete idiot. It may also mean that the documentation can be improved in places. With a lot of "grep" and fine...
Aug 4, 11:22 am 2007
Jeff King
Re: Terminology question about remote branches.
A "remote tracking branch" is a branch in refs/remotes/* that is updated by _git-fetch_ (which is in turn called by git-pull) to track a remote's position of a branch. A local branch which tracks a remote branch (I don't recall seeing the phrase "remote-tracking" -- where did this come from?) has the correct magic in .git/config to pull from a specific remote branch when Yes, although again, I think calling it a "remote-tracking branch" to mean "a local branch that tracks a remote branch" is ...
Aug 4, 8:02 am 2007
David Kastrup
Re: Terminology question about remote branches.
Jeff, I actually have no _clue_ what I "mean" with respect to the established git terminology because I can't reconcile the documentation's use of words with my meagre understanding of the technical processes involved. So I can't even tell you whether "by remote branch I mean a remote Well, of _course_ it is confusingly similar. After all, I am posting this question because I _am_ confused! And I am trying to both clear up my confusion as well as get an idea how to fix the documentation to ...
Aug 4, 8:36 am 2007
Lars Hjemli
Re: Terminology question about remote branches.
Remote-tracking branch: A local copy of a branch in another repository. This kind of branch cannot be updated by 'git-commit' but only by 'git-fetch' (hence indirectly by 'git-pull' and 'git-remote update'). If you try to 'git-checkout' a remote-tracking branch, you will get a detached HEAD. Local branch: A branch to which you may commit changes. Optionally, the branch can be configured to "follow" one of your remote-tracking branches. This means that a 'git-pull' without arguments...
Aug 4, 9:07 am 2007
David Kastrup
Re: Terminology question about remote branches.
It would be helpful. Except that nothing whatsoever can be found in .git/config concerning my local and my remote tracking branches. So where is that information _really_ hidden away? .git/FETCH_HEAD maybe? It also appears that doing git-checkout --track -b mybranch origin on a git.git clone does _not_ create a tracking branch. I can't figure out what I could specify as an origin to create a tracking branch that would get reflected in .git/FETCH_HEAD. What gives? -- David Kastru...
Aug 4, 1:00 pm 2007
Julian Phillips
Re: Terminology question about remote branches.
It really is in .git/config, _provided_ that your repo was created by 1.5.0 or newer. Older versions had a more distributed setup using files Nope, that's just information about what got fetched last. A purely With pre 1.5 you didn't get remote tracking branches in a separate namespace. The default was to have a local branch called origin which was the "remote tracking branch" for the master branch - but this wasn't enforced. So with your repo the origin branch _is_ the remote tracking...
Aug 4, 1:19 pm 2007
David Kastrup
Re: Terminology question about remote branches.
I think I am going to cry. So I need to rebase my branches, pull out the resulting patch sets, scrap my repository, clone it new from upstream, reapply my branches, in order to have a system where the documentation is somewhat in synch with the actual behavior? [...] No, it would seem that I can just git-clone -l my repository and be set up in the new order of things. Nice. However, it would appear from my experiments up to now that the --track option _can't_ be made to work with a 1.4 re...
Aug 4, 2:00 pm 2007
Theodore Tso
Re: Terminology question about remote branches.
... or you can you use "git remote" to create the remote tracking branches. The important thing to realize is that 99% of what "git remote" does is purely by editing the config file. (The last 1% is running "git fetch" if you specify the -f option.) So understanding what gets placed in the .git/config file after doing an initial clone from a URL for a pre-1.5 git and what gets placed in .git/config file and how the branches are set up post 1.5 is key to understanding what Be careful, not reall...
Aug 4, 6:56 pm 2007
previous daytodaynext day
August 3, 2007August 4, 2007August 5, 2007