Re: [git-users] Newbie: How to get my working tree back using git checkout?

2016-08-26 Thread Dale R. Worley
rh kramer  writes:
> I've tried a number of variations, but I'm not getting the software (I 
> guess git would call it the working tree) back.  Some of the variations 
> (all run from within sciscint_git):
>
> git checkout HEAD
> git checkout MASTER
> git checkout 76641b5
>
> I've also tried those with the -b option.
>
> What am I doing wrong?

The problem is that "Local modifications to the files in the working
tree are kept, so that they can be committed to the ."

What I think you need to do is "git reset --hard HEAD".

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] SHA-1 checksum

2016-08-10 Thread Dale R. Worley
Sharan Basappa  writes:
> The other question is, when it is time for Git to pick up the file 
> associated with 100644 blob 0215040f90f133f999bac86eede7565c6d09b93d then 
> it starts 
> computing checksum of all the objects?

The point is that it doesn't have to *search* for the contents of the
file, because those contents are stored in

./git/objects/02/15040f90f133f999bac86eede7565c6d09b93d

The hash of an object tells Git where the object is stored.

This is why a *cryptographic* hash must be used, so that no two
different objects have the same hash, which would require that they both
be stored in the same file.

There is the complication that a file's contents are stored compressed,
so you can't directly read the file, which is why you need to use a Git
command to get the proper file contents.

There is also the complication that "pack files" can be made that
contain many objects.  Each pack file has a corresponding index listing
all the hashes of the objects in the pack file.  Clearly, the indexes
are arranged in some way that allows Git to quickly find what objects
are in which pack file, but I do not know the details.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] SHA-1 checksum

2016-08-08 Thread Dale R. Worley
Sharan Basappa <sharan.basa...@gmail.com> writes:
> So, if Git stores files using just their checksums then
>
> a) how does it look up (or retrieve) a specific file in the database?
> For example, if it wants to find a file in the data base then it takes 
> checksum and starts computing checking of every file in its database & 
> compare?
> This looks pretty costly & rather unnecessary to me.
>
> b) how does it get keep track file names that are required when it gives us 
> a working copy? 

Consider one of my Git repositories.  The file .git/HEAD contains

ref: refs/heads/hobgoblin

That points to the file .git/refs/heads/hobgoblin, which contains the
hash of the commit which is the tip of the "hobgoblin" branch:

92f8f718eb9b19f921f20283e55c56e8dc66ed10

That point to the file
.git/objects/92/f8f718eb9b19f921f20283e55c56e8dc66ed10.  That file's
contents aren't in ASCII, so you have to use "git cat-file -p
92f8f718eb9b19f921f20283e55c56e8dc66ed10" to read its contents:

tree d5d1ad293f8fdd4a4a4e0e9a73c5c3c851126c22
    parent 39c83b086e141bb00d32737a4e2aae675d795f44
author Dale R. Worley <wor...@ariadne.com> 1470669963 -0400
committer Dale R. Worley <wor...@ariadne.com> 1470669963 -0400

...

So the hash of the tree object is
d5d1ad293f8fdd4a4a4e0e9a73c5c3c851126c22 and the hash of the one parent
commit is 39c83b086e141bb00d32737a4e2aae675d795f44.  The tree object is
in .git/objects/d5/d1ad293f8fdd4a4a4e0e9a73c5c3c851126c22, but again,
you have to use git-cat-file to read it:

100644 blob 0215040f90f133f999bac86eede7565c6d09b93d-NOTES
100644 blob ef62bfd5a8e81c8ca13372b2436bccf1c0698185-NOTES.MYOB
100644 blob 65dda34dadf753dbfc791b5811f3cd437a666cac
-NOTES.XA.recovery
100644 blob 88182ec16035fd4d77c0c1312ce1510f2f8da4b2
-NOTES.XB.recovery
100644 blob 73415b6e2ebcd6a384874c0ab40ec70a5112db18-NOTES.freeze
100644 blob 3a4fb8ec6e7c0219c4d7ab002eaaa84abae2c72d-NOTES.gleaning
04 tree c21923c2647ecec7d627a49e51b4e8b5d19344b4.a68g
100644 blob f9a4c46f50234a11f9ad283973ed2f11a4758f2f.aspell.en.prepl
100644 blob 182c2739a5cc69a322a41723d4423ed1d8a6266e.aspell.en.pws
...

The contents of file "-NOTES" is in
.git/objects/02/15040f90f133f999bac86eede7565c6d09b93d.  In this case,
that object is in one of the "pack" files.  git-cat-file has to read
through the indexes of the pack files to find that.

The critical ideas are that files are stored by their *contents* not
their *names*.  Any particular blob of content has an eternally unique
name (its hash), which will be the same in any repository containing a
blob with the same bytes.  "tree" objects are used to catalog the names
of files and their contents.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] lost file with git add - git rm -f

2016-07-31 Thread Dale R. Worley
GUGLHUPF  writes:
> fairly new to git. Today I did a "git add somefile" and then decided I 
> wanted to unstage it. I did then a "git rm -f somefile". There was no git 
> command in between. Particularly no commit.
>
> git wiped the file from disk. I worked very hard on that file (several 
> days( and I really hope this can be recovered. I could not find a solution 
> on the web. 
>
> For completeness I did a git reset HEAD somefile because that's what I 
> found on the web, but it didn't recover the file. 

One important thing is that the moment you realize the file is missing,
do a complete copy of your working directory and save it some place
safe:  "cp -a working-directory someplace-safe".  Don't do *any* Git
operation -- especially not "git reset" -- before you do that, because
further Git operations run a risk of losing information which is still
stored in some random place in the working directory/archive.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Using git log to track frequently upgraded branch

2016-07-27 Thread Dale R. Worley
Jerome Fouletier  writes:
> I have one branch BR1 which receives frequent merges from branch BR0. 
> Branch BR1 is tagged once per sprint, and I need to list the commits that 
> have been made or merged since the last tag: 
>
>
>-A1---B1(TAG)--C1---D1---E1---F1---G1(BR1)
>
>/  / /
>>
> -A0--B0C0---D0E0F1(BR0)
>>
>
> In my log, I'd want to see C1 to G1 and B0 to E0. I understand that 
> TAG..BR1 will give me C1 to G1, but how to add B0 to E0? Is it possible 
> without tagging A0?

You're going to have to *find* A0, despite the fact that it isn't
explictly tagged.  I think the definition you are using is "the last
commit on BR0 that was merged into TAG".  In that case, you can find A0
with

git merge-base BR0 TAG

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Marking a branch "closed"?

2016-07-20 Thread Dale R. Worley
Michael  writes:
> Lets say I've got a topic branch. I've made a bunch of commits. It's
> messy. But it's done.

> What do I do with the leftover? I thought I could tag it as "closed",
> but I can't use the same tag more than once. What's the best way to
> mark it as done, or should I just delete the branch label and let it
> be garbage collected/deleted?

Why not tag the branch tip with "_closed"?

And if you need to reopen the branch, just delete the tag.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How GIT stores data

2016-06-01 Thread Dale R. Worley
Sharan Basappa  writes:
> Is there a way to retrieve the previous version of the file (that is, F.1).

It looks like "git fsck --unreachable" would output the hash of such a
file.  Then you can use "git cat-file" to get the contents of each
object.  You'll have to inspect the contents manually; as far as I know
there's no record kept of where the file contents used to sit in the
directory tree.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] pushing referenced librarys

2016-06-01 Thread Dale R. Worley
Konstantin Khomoutov  writes:
> If you're pushing your project directly from Eclipse (I mean, by
> clicking some button or activating an entry of some pop-up menu) then
> you are not using Git but rather EGit -- an Eclipse's library to work
> with Git repositories which itself uses JGit -- a from-scratch
> implementation mimicking Git.  All this stuff does not use "stock" Git
> at all and does not even require it to be installed in the system.
> To being with, this is a useful thing to understand.

There's an EGit mailing list, egit-dev.
https://dev.eclipse.org/mailman/listinfo/egit-dev

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Detect which ignore file (and line) that is preventing file from being added.

2016-06-01 Thread Dale R. Worley
Fabian Jonsson  writes:
> I had a problem recently trying to add .dll files to git. No suggestion I 
> found on SO seemed to help. When trying to add each file manually in the 
> Git bash, I received a message saying that one of my ignore files prevented 
> the file from being added. I would've liked to see which one of the ignore 
> files contained that rule, as I later found it hidden in a global ignore 
> file (probably created by my Git client) that I was not aware of. 

There is a "git check-ignore" that can probably be used to solve this
problem.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How to know when git is finished

2016-05-26 Thread Dale R. Worley
Sandor Hadas  writes:
> However, if the very same script is added to cron then what happens:
> 1. Cron starts the script
> 2. Script invokes git clone
> 3. git clone spawns several "git-remote-https" processes
> 4. git returns while the spawned processes run
> 5. Commands based on the repo fail (if I add a sleep 30 before running the 
> commands then success, but that cannot be the right path)
>
> How do I make sure that a git clone is actually complete when running from 
> cron OR how do I make git run synchronously so that it does not return 
> control to the bash before it is really done (nohup did not work because of 
> the detached spawns)?

Looking at the Stack Overflow question, you put an "&" after the git
clone, which means that execution of the script should continue without
waiting for the git clone to finish.  If you want to wait for git clone
to finish, just don't put the "&" there.  (If it is followed on the same
line by another command, change "&" to ";".)

Yes, git clone starts git-remote-http processes, but git clone won't
exit until the git-remote-http processes exit.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git life cycle

2016-05-23 Thread Dale R. Worley
"Philip Oakley"  writes:
> +1 for the nice explanation.

Thanks!

> The Index is also commonly called the *staging area* when viewed from an 
> outward facing perspective (i.e. what do users do), with index being more 
> commonly used for an inward facing perspective (e.g. for code development). 

Thanks; I've added "staging area" to my guide.

> There is currently a truce about which is the 'right name'! 

And there's a third contender:  "the cache".

Of course we can't agree on the terminology to use!

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How GIT stores data

2016-05-23 Thread Dale R. Worley
Sharan Basappa  writes:
> I am pretty much new to Git though I am using it for a couple of projects 
> (without much understanding as such).
>
> In Git documents, it is mentioned that Git stores data as a stream of
> snapshots. Compared to other VCS tools, the only difference I am able
> to tell is that Git stores the entire file for each versions while
> other VCS tools might store only differences.
>
> Can someone help me understand this?

Actually, you don't *need* to understand how it's done.  You do need to
understand that Git commands are organized around the idea that commits
are a total copy of your project.

OTOH, you need to be careful.  Some commands, particularly ones
involving merging and "rebase" actually *do* think of commits not as
snapshots but as the difference between the commit and its parent.  That
is how you can "reorder" two commits -- changing the commit order from A
- B - C is actually constructing new commits D and E so that in the new
commit order A - D - E, the difference between A and D is the same as
the difference between B and C, and the difference between D and E is
the difference between A and B.

But even in this situation, what is *stored* is a sequence of commits
(done with sophisticated compression) -- the merge or rebase command
calcuates the differences based on the contents of the old commits, and
then constructs a new set of commits that have the proper differences
between them, and then stores the new commits.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Problem:fatal: early EOF fatal: index-pack failed

2016-05-20 Thread Dale R. Worley
Jeremy Yang  writes:
> When I executed the "git clone git://url -b  branch" cmd by multi-thread(40 
> threads) at the same time,several cloned failures would often occur.
>
> However,the max-connections is setted to zero which is for no limit.
>
>
> *Git-daemon CMD:*
>
> /usr/bin/git daemon --verbose --syslog --reuseaddr 
> --base-path=/home/user/repositories --max-connections=0
>
>
> *Client Log:*
>
> remote: fatal: unable to create thread: Resource temporarily unavailable

The max-connections setting may be unlimited, but that doesn't mean that
the server daemon can create an enormous number of threads.  The last
quoted line is the client reporting that the server reported that it
could not create a new thread.  There are many reasons why that might
happen.  One possibility is that the server system ran out of RAM and
swap space.  Another possibility is that the user running the server
process has a low quota of processes that it is allowed to create.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How to clone a particular revision?

2016-05-18 Thread Dale R. Worley
Konstantin Khomoutov  writes:
> Note that accessing commits by date is imprecise by its nature and,
> while useful sometimes, might indicate you're trying to do something
> wrong way.

In particular, the effects of time-zones can cause revisions to not have
the dates you expect them to.  If you are extracting a list of one or a
small number of revisions, and then examining the list personally to
find the revision you want, using dates is not particularly hazardous.
But using date-access automatically (in a script, say) can easily
malfunction.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Adding a URL to a commit

2016-05-08 Thread Dale R. Worley
Melvin Carvalho  writes:
> In npm when you have an author there's a really nice feature ... namely you 
> can add a URL :  
>
> Author: Joe Bloggs  (URL)
>
> In git you have the same message but without the optional URL at the end
>
> I was wondering how difficult it might be to add such a feature to git 
> commits?

Would it work to change the "human name" from, e.g., "Joe Bloggs" to
"Joe Bloggs (http://...)"?  (If I have it correctly, that's the
user.name configuration variable.)

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Finding which files does a given patch changes

2016-05-07 Thread Dale R. Worley
Konstantin Khomoutov  writes:
> On Fri, 6 May 2016 18:56:01 +0300
> Kevin Wilson  wrote:
>
>> Suppose you have a patch named 0001-great_change.patch
>> 
>> Is there a way by which, using some git command, you can find out
>> which files this patch changes, without that
>> you will edit (or cat/more ) that 0001-great_change.patch file?
>
> Have you tried to read the manual page of the `git apply` command?
> It's all there.

I wouldn't know for a fact, but I suspect that Keven assumed that "git
apply" *applies* the patch, and thus didn't read its manual page, since
it is clearly not relevant to his problem.  So it's probably better to
say:

There are certain options to "git apply" which, despite the name of
the function, do not apply the patch but rather display information
about the patch, and some of those options list the files that the
patch affects.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] I am a newbie

2016-04-29 Thread Dale R. Worley
Alekhya Vellanki  writes:
> I'd like to start contributing to git.
>
> I have absolutely no idea about open source projects contributions.
> I am also pretty unclear about what bugs,patches etc are.
> When I tried reading source codes of a few project ideas for GSoc 2016, I 
> could hardly understand anything.
>
> I am good with C, C++.I am currently learning JAVA, python and shell 
> scripting.

You know that you have a lot to learn.  It's better to start with a
low-profile project where the amount of work that needs to be done is
larger than the number of volunteers available to do it.  Then the other
people on the project have an incentive to help you learn how to
contribute effectively.  The best choice would be a relatively obscure
project that you personally care about, or one where you have a friend
who is already active in the project.

Git is rather the opposite, there are a large number of very experienced
people who work on it.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Feature request: -np (shorthand for --no-pager)

2016-04-28 Thread Dale R. Worley
Ashley Coolman  writes:
> Would make sense, no?

Unfortunately, no.  The convention is that "--" is used to start long
options, which may have an optional value which is started with "=":

--[a-zA-Z0-0]+(=.*)?

Options that start with "-" use the long-established conventions for
single-letter options:  Each letter after the "-" is interpreted in turn
as an option name.  However, if an option is one that takes a value,
then the remainder of the argument is the option's value, or if there
are no further characters in the argument, the entire next argument is
the option's value.  Thus, "-np" means the same thing as "-n -p", while
"--np" specifies a single option.

The degree to which various packages follow these rules varies, but
they're generallly observed.  The Gnu utilities follow them quite
strictly.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] An equivalent of `--full-history` to git bisect

2016-04-27 Thread Dale R. Worley
Ram Rachum  writes:
> Administrator@Turing  ~/Dropbox/Desktop/foo (development)
> $ git bisect start
>
> Administrator@Turing  ~/Dropbox/Desktop/foo (development|BISECTING)
> $ git bisect good 3068
>
> Administrator@Turing  ~/Dropbox/Desktop/foo (development|BISECTING)
> $ git bisect bad b7a8
> Bisecting: 0 revisions left to test after this (roughly 1 step)
> [0aa833916e908ea93902a6c4c227f9a884a1bcef] Merge branch 'master' into
> development
>
> Administrator@Turing  ~/Dropbox/Desktop/foo ((0aa8339...)|BISECTING)
> $ git bisect bad
> Bisecting: 0 revisions left to test after this (roughly 0 steps)
> [24139451ab954b1f0a9ef616775a3dba0ac81669] Creating some-file
>
> Administrator@Turing  ~/Dropbox/Desktop/foo ((2413945...)|BISECTING)
> $ git bisect bad
> 24139451ab954b1f0a9ef616775a3dba0ac81669 is the first bad commit
> commit 24139451ab954b1f0a9ef616775a3dba0ac81669
> Author: Ram Rachum 
> Date:   Tue Apr 19 16:01:28 2016 +0300
>
> Creating some-file
>
> :00 100644 
> e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A  some-file
>
> Administrator@Turing  ~/Dropbox/Desktop/foo ((2413945...)|BISECTING)
> $

OK, I've had to learn some things first.  One is that git-bisect doesn't
find the commit along the path between a good commit and a bad commit
that introduces a bug.  You specify a bad commit and git-bisect finds an
"original bad" ancestor:  a commit that is an ancestor of the specified
bad commit that is bad and has no parent that is bad.

In this case, your command "git bisect good 3068" does *not* restrict
git-bisect's attention to the commits in 3068..b7a8.  It just tells
git-bisect that 3068 is good.  git-bisect still has to check the
ancestors of 2413, which are ancestors of b7a8 but not ancestors of
3068.

With this definition, it's clear that git-bisect should identify cf02 as
the "original bad" commit, because it's the only one.  If it doesn't,
that's a bug in Git.  And I'm not so surprised that it doesn't handle
that special case correctly, it's not an obvious one.  You should report
that as a problem on the main Git mailing list.

Now to solve your problem:  What you need to do is redefine "bad" to
mean "should have sugar but does not".  That is, "is a descendant of
3068 and does not have sugar".  When you do that, 2413 becomes good,
because it's not a descendant of 3068.  And I'll bet that if you say
"git bisect good" for 2413 you will get the result you expect.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] An equivalent of `--full-history` to git bisect

2016-04-26 Thread Dale R. Worley
Ram Rachum  writes:
> $ git log  --graph
> * commit b7a8d7aa001d06eb7491ab5fb447a8dd3aa421a8
> | Author: Ram Rachum 
> | Date:   Tue Apr 19 17:45:01 2016 +0300
> |
> | adding more to some-file
> |
> *   commit 0aa833916e908ea93902a6c4c227f9a884a1bcef
> |\  Merge: 2413945 3068c7d
> | | Author: Ram Rachum 
> | | Date:   Tue Apr 19 17:44:31 2016 +0300
> | |
> | | Merge branch 'master' into development
> | |
> | * commit 3068c7d2548f1798b6840f73b13a649937339f28
> | | Author: Ram Rachum 
> | | Date:   Tue Apr 19 16:02:27 2016 +0300
> | |
> | | Adding sugar to coffee
> | |
> * | commit 24139451ab954b1f0a9ef616775a3dba0ac81669
> |/  Author: Ram Rachum 
> |   Date:   Tue Apr 19 16:01:28 2016 +0300
> |
> |   Creating some-file
> |
> * commit cf02fbbc40104cd02eea4c7c6f134ef1fd7b5661
>   Author: Ram Rachum 
>   Date:   Tue Apr 19 16:00:47 2016 +0300
> 
>   Create coffee
>
> In the very first commit, the file `coffee` was added. In the commit 
> `3068c7d`, I added a line "sugar" to the `coffee` file. But then I merged 
> this branch into the `development` branch, and in that merge, a mistake was 
> made and the "sugar" line was removed, leaving `coffee` empty. Then another 
> commit `b7a8d7a`, making an unrelated change, was added for good measure. 

> I also tried using `git bisect` to pin down the two commits, but it pointed 
> me to the wrong commit after I finished doing all the `git bisect bad` and 
> `git bisect good` actions.

That seems really unlikely, since there is only one path between 3068
and b7a8.  Can you reproduce the behavior and show us how it happened?

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Will GIT allow me to do this?? show tag history and where it was pinned on to which branch in the past

2016-04-24 Thread Dale R. Worley
Andrew Acevedo  writes:
> I'm not familiar with git, but can the same tag be moved around on several 
> branches and a history is kept which position on the branch it's been 
> pinned too before?

I might be wrong, but I think the behavior (at least, the default
behavior) is to log the past values of a tag into the corresponding file
in .git/logs/tags.  But it's possible that sufficiently old values
recorded in the log file are eventually removed.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] An equivalent of `--full-history` to git bisect

2016-04-22 Thread Dale R. Worley
Ram Rachum  writes:
> Then, as I said in the beginning, a friend pointed me towards the 
> `--full-history` flag:
>
> $ git log --full-history --graph coffee
> *   commit 0aa833916e908ea93902a6c4c227f9a884a1bcef
> |\  Merge: cf02fbb 3068c7d 
> | | Author: Ram Rachum 
> | | Date:   Tue Apr 19 17:44:31 2016 +0300 
> | |
> | | Merge branch 'master' into development 
> | |
> | * commit 3068c7d2548f1798b6840f73b13a649937339f28
> |/  Author: Ram Rachum 
> |   Date:   Tue Apr 19 16:02:27 2016 +0300 
> |  
> |   Adding sugar to coffee 
> |  
> * commit cf02fbbc40104cd02eea4c7c6f134ef1fd7b5661  
>   Author: Ram Rachum   
>   Date:   Tue Apr 19 16:00:47 2016 +0300   
>
>   Create coffee
>
> This makes me happy because it shows the two relevant commits, the one 
> adding sugar and the merge that removed it. So my problem is solved. **But 
> I really wish I could know how to make `git bisect` as well.** Does anyone 
> happen to know?

You have to be careful here.  You *think* of commit 0aa833 as removing
sugar, but it only removes sugar with respect to commit 3068c7.  It's
*other* parent doesn't have sugar, in fact, has the same file tree as
0aa833.  When you look at 0aa833 as a child of cf02fb, what you see is a
merge that didn't insert sugar that was present in the merged commit.
And if sugar was some debugging print that you added to the branch to
test it, you'd think of things the second way.

The deep question is "What is the (linear) history of this commit?"  You
*think* of the history being 0aa833-3068c7-cf02fbbc, but it's equally
valid to think of it as 0aa833-cf02fbbc.

Now with regard to git-bisect, how do you define it?  The binary search
for "Where was this introduced?" only makes sense along a linear path.
So which linear path should git-bisect choose through the directed
acyclic graph of commits?

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git branch history

2016-04-12 Thread Dale R. Worley
Kevin Wholley  writes:
> I would like to see a history of any branch that merges into another 
> branch. For example I have master as my production code. I also have a 
> build branch and several development branches. When a development branch is 
> ready to build we merge into our build branch. At this point this command 
> is fine "git branch --merged" however, when the development branch changes 
> and the commit point moves this command does not list the branch(s) that 
> merged to the build branch. I need to know all the changes merged in from 
> the dev branches to the build branch regardless if the commit point 
> changes, kind of like a full history of the build branch. Is this possible? 
> How is it done?

If I understand you correctly, I think "git log --graph "
will show you the history of the chosen branch with all merges going
into it.  What it doesn't do is label which ancestory commits are "part
of which branches".  In Git, that isn't a well-defined concept; commits
exist in a directed acyclic graph, and branches are pointers to
commits.  So the commit "my-branch^" doesn't *belong* to my-branch,
though in fact that commit may be reachable only from the commit
my-branch.

(Though it would help if "git log --graph" would label commits that are
branch heads.)

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] "Not a git repository" on server side trying to clone a project over HTTP with git-http-backend

2016-04-06 Thread Dale R. Worley
Eli  writes:
> I'm trying to use Git over HTTP but I'm getting the error
> [Wed Apr 06 13:35:15.208592 2016] [cgi:error] [pid 6821] [client ...] 
> AH01215: Not a git repository: '/var/git/repositories/my-project.git'
>
>
> On the client side I'm trying this:
>
> git clone http://myhost.com/git/my-project.git/
> Cloning into 'my-project'...
> fatal: repository 'http://myhost.com/git/my-project.git/' not found
>
> On the server side:
>
> The Apache Server is the version 2.4 and It has this configuration:
> SetEnv GIT_PROJECT_ROOT /var/git/repositories
> SetEnv GIT_HTTP_EXPORT_ALL
> ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
>
> 
> Options +ExecCGI
> Require all granted
> 
>
> The project root rirectory /var/git/repositories has the my-project.git 
> directory that was initialized with the command git --bare init 
> my-project.git. I also change the owner of the my-project.git directory to 
> be the same as apache, so, chown -R apache:apache 
> /var/git/repositories/my-project.git.
>
> Could you please help me figure out what I'm doing wrong? What I missed?

I'd try logging in on the server as apache, then running the
git-http-backend command that Apache should be running and see what it
says.  Even better if you can get Apache to log exactly how it is
calling git-http-backend.  If the script gives you the same error, then
you know it isn't an Apache configuration problem.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git says there are local changes, but there are no changes. (Windows)

2016-02-24 Thread Dale R. Worley
Ben Page  writes:
>>git status
> On branch master
> Your branch is behind 'origin/master' by 2 commits, and can be 
> fast-forwarded.
>   (use "git pull" to update your local branch)
> Changes not staged for commit:
>   (use "git add ..." to update what will be committed)
>   (use "git checkout -- ..." to discard changes in working directory)
> modified: XXX
> modified: YYY
> no changes added to commit (use "git add" and/or "git commit -a")

Certainly one thing you can do is "git diff XX" and see what Git
thinks the changes are.

Unfortunately, I don't know if git-diff is completely rigid about
reporting different ends-of-lines.  You can
mv XX XX.old
git reset --hard
diff XX XX.old
if you know that the diff you are using reports all byte differences.

As the other responder said, the underlying cause is likely file name
casing or ends-of-lines, which are the sort of things that get
translated between files in the working directory and the repository.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] No doubt a simple question

2016-02-17 Thread Dale R. Worley
Konstantin Khomoutov  writes:
> I'd say there are only one reason for the
>
>   git checkout HEAD file1 file2 ...
>
> invocation to fail file1 starts with a dash or double dash and gets
> interpreted as a command-line option.

I went back and checked my command window transcripts, and the problem
is that, for some unknown reason, I was always using '-p' with 'git
checkout'.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Changeset evolution, History Rewriting in a public GIT repository

2016-02-17 Thread Dale R. Worley
Konstantin Khomoutov  writes:
>>4. We would like to now be able to completely eject/remove the 
>> commit/patch from the staging git repository, as if it never went in,
>> as well as any other commits that might be related to it that came in
>> after that, and NOT just attempt to reverse it by committing a
>> reversal patch at the end.
>
> I'm afraid that "as well as any other commits that might be related to
> it" bit was not thought out very well.
>
> Say, the devs pushed 10 commits to your staging repo; the 3rd one
> was detected to having had introduced a faulty change.
> Do you have a robust algorythm to figure out which of the remaning 7
> commits are related to that faulty one?

I'm sure that the only effective way to do it accurately is to require
the developers to flag each commit's dependency on previous commits.
Then again, in a way, that data is captured by the history of the new
commit *in the developer's* working tree.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] No doubt a simple question

2016-02-12 Thread Dale R. Worley
Suppose I've modified a file, or a set of files, and I want to return it
to the state in HEAD.  I thought that "git checkout HEAD file1 file2
..." would do that, but git-checkout wants to preserve whatever changes
are present in the file tree.  I'm sure that buried in Git's UI is a
command form that will do this easily, and I probably knew it once, but
I've forgotten.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Storing file on a server rather than on the git folder

2016-02-12 Thread Dale R. Worley
Theo G  writes:
> We use Git on Windows and SourceTree as a Visual interface for Git.

It sounds like the only acceptable solution is one that can be operated
using SourceTree.  So the question is, is there a facility in SourceTree
for this?  I think you would be more likely to get a useful answer if
you ask where SourceTree users get support.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Need some advice on git setup -- development files must be run on the server

2015-05-26 Thread Dale R. Worley
Chris Fillmore fillmore.ch...@gmail.com writes:
 I am imagining I putty into the server, checkout my branch, run the code. 
 Is this possible? But what's to stop other team members from doing the 
 same, at the same time? There are only three of us, we can communicate, but 
 in principle I would prefer to have a better solution, if possible.

It sounds to me that this is the crucial problem -- you have only one
test environment, and only one person can use it at a time.  It seems to
me that productivity would be seriously improved if each developer had a
complete test environment.  One way to do that would be VMs, another
would be to buy a bunch of cheap servers.  My guess is that you want the
best duplicate of the production environment you can manage, so as to
minimize the number of surprised when you move code into production.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git considers .org file as binary

2015-05-20 Thread Dale R. Worley
Rainer M Krug r.m.k...@gmail.com writes:
 for some strange resold, git considers my emacs.org file (which is a text 
 file) as a binary. This is only in one repository, and other .org files are 
 seen as text.

http://fileinfo.com/extension/org says that .org is the extension used
by Lotus Organizer, so perhaps someone along the line has set the Git
installation or repository to assume that such files are binary.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How to checkout files from another branch, based on a filelist from a text file?

2015-05-18 Thread Dale R. Worley
Konstantin Khomoutov flatw...@users.sourceforge.net writes:
 My problem is, that I can not see possibility to checkout files from 
 another branch, based on a filelist from a text file.

 Once you have a text file with the list of file names,
 just do

   $ git checkout dev
   $ while read fname; do \
 git checkout local_dev $fname; done  dev_files.txt

Even shorter:

$ git checkout local_dev $( cat dev_files.txt )

If you're not using bash, use:

$ git checkout local_dev `cat dev_files.txt`

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Merge conflict error, when there was no change in mentioned file

2015-05-16 Thread Dale R. Worley
Philip Oakley philipoak...@iee.org writes:
 You may find that there are 'end of line' differences between the
 commits in the server, and the commits you have locally, which after
 eol conversion, look identical, but the different eol strings makes
 the sha1's different.

Yes, it's usually the case when files look the same but the merge
program doesn't like them that there is an end-of-line problem.  Worse,
the *same file contents* can mean logically different things if one
version of the file is interpreted in one way in regard to line endings
and the other version is interpreted in a different way.

To start diagnosing the problem, the first thing is to extract the
hashes of the files as Git has them recorded.  Another is to get Git to
output the two files and you save them into two files.  Then use some
stupid program like cmp to check whether the files are *actually*
byte-by-byte identical.  (When you're having problems like this, avoid
using any intelligent file comparison program, because such programs
often apply their own interpretation to the files they handle -- 99% of
the time, it helps the user, but this is one of the 1% situations.)

Another thing to do is check out one of the commits, then manually run a
checksum program (e.g., sha1sum) on the file in question.  Then check
out the other commit, and manually run the checksum.  Are the checksums
the same?  Do they agree with the checksums Git has recorded for the
files in the commit objects?

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Use git on microsoft words documents

2015-05-14 Thread Dale R. Worley
From the original poster's point of view:  Yes, you can use Git to store
various versions of MS Word documents, but you probably don't get much
benefit from doing so, since Git can't see into the different versions
of documents to see how they differ; to Git they're just blobs.  OTOH,
it may be that collections of blobs is all that you need the storage
system to provide.

Konstantin Khomoutov flatw...@users.sourceforge.net writes:
 Steve (Gadget) Barnes gadgetst...@hotmail.com wrote:
 At the risk of getting flamed for mentioning a differnt dVCS, the 
 Mercurial, (hg), project has a very sneaky extension called zipdoc
 that stores the content of the zip files, (docx are actually zips
 containing XML), and the fact that they belong in a specific .docx,
 (or whatever), file.  On committing such a file it is actually
 unzipped and the constituents either stored, or for an update, diffed
 and then on a pull they are pulled as constituent parts and then
 zipped to reconstitute the original file.
 
 You could either consider using Mercurial or trying to find or
 develop a similar extension.

 I wonder what this actually buys: you'll end up with a bunch of XML
 files (and picture files, if any, and the Manifest file, and so on),
 and the problem is that that XML file representing the content is as
 readable as the original .docx.  As they say, XML combines the
 efficiency of text files with the readability of binary files [1].
 I mean, diffing a machine-produced XML files, where a tiny
 logical change in a document could result in hefty parts of that XML
 swath rewritten is just marginally better than the original problem.

The question is this:  If you make a small change to the document (as a
human sees it), does this cause a small change to the XML files within
the Zip?  If the answer is Yes, then many revisions of a document can be
stored densely in a repository.  And it might be possible to merge small
differences in documents using a standard merging approach.

But the only way to know would be to talk to someone who has
considerable experience with this.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Help with git reset, please.

2015-05-13 Thread Dale R. Worley
Michael keybou...@gmail.com writes:
 those two sentences say the same thing.  HEAD *is* the branch tip pointer,
 unless it's detached.

 Alright, maybe this is my first point of confusion.

 I thought HEAD is where you are at -- which of those letters you are
 pointing to.
 And, it may also be where a branch tip is pointing.

 If I make a commit while on a branch, then HEAD -- which letter I'm at
 -- updates, and the branch tip pointer also updates.

 If I'm detached, then which letter I'm at updates, but the branch tips do not.

 Based on that, I thought that git reset --soft would change which
 letter I'm pointing at, and leave the branch pointers unchanged.

Your terminology is hard to follow here.

There are two situations:

1) Normally, HEAD is (effectively) a symlink to one of the branch names,
which in turn points to a commit.  If you git-commit, the index contents
are used to make a new commit, that commit's parent is the commit
pointed by the branch name that is the target of HEAD, and that branch
name is updated to the new commit (and so HEAD also points to that
commit, in two steps).

2) A detached HEAD is a pointer to a commit.  Creating a new commit does
a similar this as in (1), but only HEAD is updated.

git reset --soft changes what branch name HEAD links to.

But here, to get to the bottom of the problem, please construct a
reproducible example of it, using only command-line operations.  Then we
can tell exactly what you did (with no possibility that you make a
mistake in describing it), and reproduce it ourselves.  IIRC, git log
--graph can show the history of may branches.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Help with git reset, please.

2015-05-12 Thread Dale R. Worley
Michael keybou...@gmail.com writes:
 keybounceMBP:config michael$ git commit -m First test
 [animalAging 0653a0b] First test
  1 file changed, 140 insertions(+)
  create mode 100644 HarderWildlife.cfg
 keybounceMBP:config michael$ gitk --all
 ^C
 keybounceMBP:config michael$ git commit HarderWildlife.cfg -m Works good 
 enough. Mod updated.
 [animalAging 3d5c944] Works good enough. Mod updated.
  1 file changed, 20 insertions(+), 2 deletions(-)

 ## At this point, I have committed my first edits, from the index, verified 
 that it was in,
 ## and then committed the final file, with the additions from the new version 
 of the program.

 keybounceMBP:config michael$ git reset --soft master

 ## I am trying to take this config file, as-is, to put into master, to keep 
 the master branch
 ## clean (while using the topic branch for development work)

 keybounceMBP:config michael$ gitk --all

 ## But ... my last two commits do not show up at all???

What branch was checked out when you did those two commits?  If I read
the output of git-commit correctly, the branch was anamalAging.  But the
git-reset changed the checked out branch to master, which of course, did
not show the commits made on another branch.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How do you switch head location without changing files?

2015-05-10 Thread Dale R. Worley
Michael keybou...@gmail.com writes:

 Lets say you've got files set up to commit to one point in the tree,
 but you're actually in a different location. How do you move where you
 are / where a commit will go, without altering the files?

git reset --soft branch

looks like the command that does what you want.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git common options

2015-04-25 Thread Dale R. Worley
Peng Yu pengyu...@gmail.com writes:
 Hi, git-annex has a set of COMMON OPTIONS options (they are applicable
 to all git-annex commands). Is there something similar for git?

 https://git-annex.branchable.com/git-annex/

The 'git' manual page on my system includes this section, which appears
to be the common options for git:

OPTIONS
   --version
   Prints the Git suite version that the git program came from.

   --help
   Prints the synopsis and a list of the most commonly used commands.
   If the option --all or -a is given then all available commands are
   printed. If a Git command is named this option will bring up the
   manual page for that command.

   Other options are available to control how the manual page is
   displayed. See git-help(1) for more information, because git --help
   ...  is converted internally into git help 

   -c name=value
   Pass a configuration parameter to the command. The value given will
   override values from configuration files. The name is expected in
   the same format as listed by git config (subkeys separated by
   dots).

   --exec-path[=path]
   Path to wherever your core Git programs are installed. This can
   also be controlled by setting the GIT_EXEC_PATH environment
   variable. If no path is given, git will print the current setting
   and then exit.

   --html-path
   Print the path, without trailing slash, where Git's HTML
   documentation is installed and exit.

   --man-path
   Print the manpath (see man(1)) for the man pages for this version
   of Git and exit.

   --info-path
   Print the path where the Info files documenting this version of Git
   are installed and exit.

   -p, --paginate
   Pipe all output into less (or if set, $PAGER) if standard output is
   a terminal. This overrides the pager.cmd configuration options
   (see the Configuration Mechanism section below).

   --no-pager
   Do not pipe Git output into a pager.

   --git-dir=path
   Set the path to the repository. This can also be controlled by
   setting the GIT_DIR environment variable. It can be an absolute
   path or relative path to current working directory.

   --work-tree=path
   Set the path to the working tree. It can be an absolute path or a
   path relative to the current working directory. This can also be
   controlled by setting the GIT_WORK_TREE environment variable and
   the core.worktree configuration variable (see core.worktree in git-
   config(1) for a more detailed discussion).

   --namespace=path
   Set the Git namespace. See gitnamespaces(7) for more details.
   Equivalent to setting the GIT_NAMESPACE environment variable.

   --bare
   Treat the repository as a bare repository. If GIT_DIR environment
   is not set, it is set to the current working directory.

   --no-replace-objects
   Do not use replacement refs to replace Git objects. See git-
   replace(1) for more information.

   --literal-pathspecs
   Treat pathspecs literally, rather than as glob patterns. This is
   equivalent to setting the GIT_LITERAL_PATHSPECS environment
   variable to 1.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 377826: invalid start byte

2015-04-08 Thread Dale R. Worley
python.beggine...@gmail.com writes:
 I am getting the following error while executing the below code snippet 
 exactly at the line if uID in repo.git.log():, the problem is in 
 repo.git.log(),the error happens way down in the bowels of the 
 repo.git.log() command, I think because the output produced by the git 
 command doesn't produce UTF-8. That could be because the git log contains 
 non-UTF-8 data, or for a different reason.

 how do I convert repo.git.log() into decode(utf-8)?

 ..
 uID = 
 gerritInfo['id'].decode(utf-8)
 if uID in repo.git.log():
 inwslist.append(gerritpatch)  
 .

What program is this code in?  Is it part of Git?

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] problem merging one repo

2015-04-03 Thread Dale R. Worley
SoaringEagle hseum...@gmail.com writes:
 1.  #  in the top-level directory of the cloned foo.git, add the bar repo 
 as remote_bar:
 git remote add bar_remote barRepoGitURL
 git fetch bar_remote

 2.  #  merge the bar repo into foo
 git merge -s ours --no-commit bar_remote/master

I'm no expert, but my guess is that you're telling Gig merge everything
between the two commits, and where they differ, choose 'ours'.  But
since the top-level directories have different names, the two commits
differ regarding *everything*, so you only get the 'ours' stuff.

I think you could accomplish this by creating two clones, one with foo
checked out and one with bar checked out.  Then, in foo.git, do

cp -a bar.git-working-directory/* .
git add -A

Now you have all eight directories in your working directory.

Construct the file tree for a new commit containing all these files:

tree=$( git write-tree )

Create a new commit containing these files and with both the foo and bar
commits as parents:

commit=$( git commit-tree $tree foo-HEAD bar-HEAD )

Check out the new commit:

git checkout $commit

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git for XCODE lost uncommitted changes

2015-03-02 Thread Dale R. Worley
AJ Manoulian alexmanoulia...@gmail.com writes:
 I have a project in xcode and I did a time machine backup of everything 
 before I did a clean install of the new OS. I had some changes in my 
 project that I hadn't committed to git. When I brought all my files back on 
 to the computer, all those changes seemed to be lost. When I open up the 
 project file it is the version from when I performed my last commit. Has 
 this happened to anyone else? Does anyone know where to look for the most 
 current file? I'm pretty new to git and xcode, so sorry if I'm leaving 
 anything out. 

I don't know how XCODE works, but if your changes were saved in files in
some way, and if you really did back up everything with Time Machine
after putting the changes in files, a complete file restore should
restore those changes.

One possibility that would have the symptoms you see is that if the
changes were stored in files, but the project file had somehow not
recorded the changes and the corresponding files they are in.  And that
could happen if you hadn't gotten XCODE to write to disk everything that
it knew.  Usually you can make that happen in IDEs by shutting them
down.

So you could be in the situation where the changes are somewhere on
disk, but the project file doesn't know about them, and so XCODE won't
show them to you.

In any case, look at the directory that Time Machine shows you of that
last backup.  The odds are good that your changed file are there
somewhere.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How to use git to store large files without keeping track of versions?

2015-02-24 Thread Dale R. Worley
This is so elegant, but:

Konstantin Khomoutov flatw...@users.sourceforge.net writes:
   $ git cat-file my-big-file^{} /some/path/to/my-big-file

I think you have to say git cat-file blob my-big-file^{} 

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



Re: [git-users] Question: how to obtain branch information from tag?

2015-01-28 Thread Dale R. Worley
Jagadeesh N. Malakannavar mnjagade...@gmail.com writes:
 Is there any way to get branch details using tag name?

What do you mean?  A tag denotes a particular commit, not a branch.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Best practices: Derived Files

2015-01-21 Thread Dale R. Worley
Owen Densmore o...@backspaces.net writes:
 What's the best practice for derived files in a git repo?

Don't put them in the repository.

There are only two cases:  (1) The version of the derived file in the
repo is correct relative the files that it's derived from.  In that
case, the derived file is redundant.  (2) The version of the derived
file in the repo is *not* correct relative the files that it's derived
from.  In that case, the derived file is dangerous.

If you deploy something from a repository, it's best to have a separate
repository (or perhaps branch) whose commits are created automagically
by a build process from the commits of a source repository, and contain
only the files that need to be deployed.  You *don't* want to have the
software developers responsible for keeping derived files in a source
repo synchronized with source files.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Commit not happening , origin/master diverged . How to commit without pulling the last commit code .

2015-01-11 Thread Dale R. Worley
Vishal Dandge vis...@mink7.com writes:
 i tried everyday to commit but was able to commit .

Do you mean *un*able to commit?

What command did you execute?  What error did you receive?

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] .gitignore pattern

2015-01-05 Thread Dale R. Worley
Rainer M Krug r.m.k...@gmail.com writes:
 Actually, I would like to exclude all files which have the
 following pattern:

 EnergyBalance.org[SOMETEXT]

 I tried

 EnergyBalance.org[.]
 EnergyBalance.org[*]

 but none worked.

I don't know what notation you're using for the following pattern.  Be
aware that Git uses wildcard notation.  (Maybe it can be configured
for other types of notation.)  If you mean that the base file name
(the name within the nearest containing directory) matches the regexp
EnergyBalance\.org.*, the wildcard version is EnergyBalance.org*.

If you want to exclude such files no matter what directory they are in,
put that line in the .gitignore of the top working directory.  If you
want ot exclude such files in a particular directory, put
/EnergyBalance.org* in the .gitignore of the directory.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] user jhu06: authentication failure for /opt/git/web-app.git/info/refs: Password Mismatch

2014-12-11 Thread Dale R. Worley
Jirong Hu jirong...@gmail.com writes:
 I just run another test. When I start the httpd, this message appears in 
 the error.log. I have to shut it down immediately. I am wondering which 
 product/process I am using will automatically send request to git? Maven, 
 TeamCity, Artifactory? I am not running any builds or scheduled. What will 
 constantly send request to access GIT?

 [Thu Dec 11 14:16:50 2014] [notice] suEXEC mechanism enabled (wrapper: 
 /usr/sbin/suexec)
 [Thu Dec 11 14:16:50 2014] [notice] Digest: generating secret for digest 
 authentication ...
 [Thu Dec 11 14:16:50 2014] [notice] Digest: done
 [Thu Dec 11 14:16:50 2014] [notice] Apache/2.2.15 (Unix) DAV/2 configured 
 -- resuming normal operations
 [Thu Dec 11 14:17:12 2014] [error] [client 10.193.20.116] user jhu06: 
 authentication failure for /opt/git/web-app.git/info/refs: Password 
 Mismatch
 [Thu Dec 11 14:17:25 2014] [notice] caught SIGTERM, shutting down
 [root@cmtoldshrdjk01 logs]#

It is difficult to determine what is accessing Apache here.  You do know
that it is running on host 10.193.20.116.  Do you know what host that
is, and what activities happen on it?  One way to determine that is to
run a command like while sleep 0.1 ; do ( date ; netstat --inet -p
)/tmp/log ; done as root on that host.  It will capture a detailed
list of all processes that are making TCP connections.  Then check this
list against the Apache log to see what program is connecting to Apache.

Given the line DAV/2 configured, it appears that Apache is configured
to support DAV.  That means that a DAV client might be attempting to
access the server.  If you disable DAV in the Apache configuration and
the error does *not* appear, that suggests the problem is due to some
DAV client attempting to perform some operation.

But better would be to examine the Apache logs to determine exactly what
the request was.  If the logs do not contain enough information, you
should tell Apache to log more verbosely.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git stash restores some, but not all, changes

2014-12-11 Thread Dale R. Worley
Fortunately, git diff stash@{0} will probably show the differences
between the stashed files and your current working directory.  It seems
like Git is smart enough to know that the stash-pop is failing and not
delete record of the top stash.

But it does sound like there are a number of bugs in git-stash.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] user jhu06: authentication failure for /opt/git/web-app.git/info/refs: Password Mismatch

2014-12-10 Thread Dale R. Worley
Jirong Hu jirong...@gmail.com writes:
 I have a GIT running on a Linux server. When I start the httpd service on 
 the server, login with my id/password to 
 http://cmtoldshrdjk01.dev.bmocm.com/web-app2.git/, my account got locked 
 due to the following error found in the error.log

 Where shall I look for the issue?

 [Tue Dec 09 16:12:55 2014] [error] [client 10.193.20.116] user jhu06: 
 authentication failure for /opt/git/web-app.git/info/refs: Password 
 Mismatch
 [Tue Dec 09 16:13:13 2014] [error] [client 10.115.110.172] File does not 
 exist: /opt/git/favicon.ico

Do the user name and password you are using match the password file that
httpd is using to authenticate requests?  (It probably isn't
/etc/passwd.)

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] GIT server is not working

2014-12-04 Thread Dale R. Worley
Is the server process running on cmtoldshrdjk01?  What do its log files
say?  Can you connect to cmtoldshrdjk01 port 80 using telnet from the
server itself?

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Different behaviour for git add with ignored files

2014-12-04 Thread Dale R. Worley
Guilherme guibuf...@gmail.com writes:
 In my .git/info/exclude i have the patterns:

 !COM/config/Project.gny
 (...) other ignores
 /COM/config
 (...) more ignores

Is that perhaps a mistake?  I believe you want the first line to be
!/COM/config/Project.gny, because there is only one Project.gny file
that you want to include.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Re: git fsck finds a missing blob but doesn't say why

2014-12-04 Thread Dale R. Worley
Thomas Ferris Nicolaisen tfn...@gmail.com writes:
 Here's what happens when I try removing some random object in my Git repo 
 (using Git 2.0.0):

 git init; git add .;git commit -m inital
 rm .git/objects/00/79c7f07eb4bfbc08cc21f3324e7997e0b05415
 git fsck

 Checking object directories: 100% (256/256), done.
 broken link fromtree c862bb1ab77b0d118009961c1f06d8954f98db8f
   totree 0079c7f07eb4bfbc08cc21f3324e7997e0b05415
 missing tree 0079c7f07eb4bfbc08cc21f3324e7997e0b05415 

 Here I tried removing a blob instead:

 rm .git/objects/ac/9ea1b673c0bb4501415550d492474700d6bd2f
 git fsck   
   
 Checking object directories: 100% (256/256), done.
 missing blob ac9ea1b673c0bb4501415550d492474700d6bd2f

 So, recreated the issue, in any case. The only difference was that I found 
 the blob-to-delete by looking with ls-tree, while the first one was totally 
 random.

 I'd keep trying around a bit, see if you can find a pattern, and then ask 
 on the git-dev list.

Part of my complaint is that, of necessity, git-fsck knows what the
broken pointer is.  Indeed, it may have in its internal state all the
information needed to show the complete path from a root to the missing
blob.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] git fsck finds a missing blob but doesn't say why

2014-11-29 Thread Dale R. Worley
(I am using git version 1.8.3.1.)

Some references for git-fsck are like this:


https://git.help.collab.net/entries/22580428-Recovering-from-repository-corruption

$ git fsck --full
broken link fromtree 2d9263c6d23595e7cb2a21e5ebbb53655278dff8
  toblob 4b9458b3786228369c63936db65827de3cc06200
missing blob 4b9458b3786228369c63936db65827de3cc06200

that is, when git-fsck reports a missing blob, it tells what object
contained a link to the blob.

However, when I run git-fsck, all I get is the missing blob's hash:

$ git fsck --full
Checking object directories: 100% (256/256), done.
Checking objects: 100% (4038/4038), done.
missing blob 2322b10fb1cdab6fb38a9ad1c2042285939553b6
missing blob 955c487443b7c11202aca66a0fcb0a1b29ce4645
missing blob fb67076078ca5f64f8eb6a29481f1ab4ff9bca5d
missing blob a7edc7ed7a924b4e2aca62d3462fe1fdfd510d5b

It seems to me that the first style is much more useful, and indeed it
should be augmented so that it can show the complete traceback back to
a root of the object structure (typically a refs value).  Is there
any way to activate the first style?

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How to move manually-versionned files to git (version control)?

2014-11-27 Thread Dale R. Worley
 From: John McKown john.archie.mck...@gmail.com

 commit -m 'myfile as of date from filename'

The manual page for git-commit says:

   --date=date
   Override the author date used in the commit.

DATE FORMATS
   The GIT_AUTHOR_DATE, GIT_COMMITTER_DATE environment variables and the
   --date option support the following date formats:

There seems to be an author date and a commit date in Git commits,
so it looks like you can set the author date to be the date the
original file was saved and still record the date you created the Git
commit as the commit date.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Merge without replacing the outdated data.

2014-11-19 Thread Dale R. Worley
 From: Dmitry Moscow koktebelnig...@gmail.com

 I got to branch A which I want to 'merge' (preserving the differencies) 
 with branch B. 
 I run git read-tree -m HEAD branch B
 I get a number of files updated and added in my working folder. Files that 
 were absent in branch A are added, the differenceis are applied. But 
 unfortunately the differencies between the files are still erasing the old 
 lines. I mean if there were difference in branch A and branch B on the same 
 line in some file - after this command lines of that file in branch A where 
 I run the command are replaced with lines from branch B. And there is no 
 conflict. So it loooks like typical merge.

It seems to me that it would work to construct two working
directories, one for each branch.  Run diff -r --brief A B between
working directories, which will tell you all of the differences.  Copy
or merge what you desire from B into A, so that A is the merged file
tree that you desire.  Do git add in A to update the index to match
the working directory.  Do git write-tree to create a tree object in
the repository from the index.  Then do git commit-tree [hash of
tree] [head commit of A] [head commit of B] to create a new commit
containing the merged code and with the heads of A and B as parents.
Then use git branch -f [branch] [new commit hash] to set the head of
whatever branch you want to be the new commit.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Problems with .gitignore and the argument --separate-git-dir

2014-11-19 Thread Dale R. Worley
 From: Arnaud BONNET abo...@gmail.com

Process used:
1- Creation of deposit (made with the user ace)
  1- cd /home/ace/RDS/010
  2 git init --separate-git-dir=/home/ace/RDS/010.git
  3 echo *%  /home/ace/RDS/010.git/.gitignore
  4 echo * ~  /home/ace/RDS/010.git/.gitignore
  5 echo chn/  /home/ace/RDS/010.git/.gitignore

Should be echo *%  /home/ace/RDS/010/.gitignore.

.gitignore lists the files to be ignored in the directory containing
the .gitignore file.  .gitignore is not part of the .git directory.

  6- git add.
  7- git commit -m $ date: initialization
  8- git clone --bare --shared /home/ace/RDS/010.git 
 /home/ace/depotGIT/RDS010.git
 
2 Use by developers (eg with the user Arno):
  1- cd /home/arno
  2- git clone ssh: //ace@localhost//home/ace/depotGIT/RDS010.git - 
 first time
  3- cd /home/ace/RDS010 + git pull ssh: 
 //ace@localhost//home/ace/depotGIT/RDS010.git - next  time

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] On bash doing git add '' some-existing-file troubles

2014-11-17 Thread Dale R. Worley
 From: Guilherme guibuf...@gmail.com
 
 The problem here is not the LF to CRLF conversion i know where that
 comes from. The problem is that doing
 
 git add '' CDD/CDD_Diag.c
 
 results in a message about another file which was clearly not my
 intention to add.

When I experiment, git add '' seems to have the same effect as git
add ., which is not surprsing.

The problem is that you're invoking git-add with arguments whose
effect is not specified.

The solution is not to invoke git-add with a zero-character argument.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git 1.9.4‏ for window prompt sh.exe: /dev/null No such file or dirctory

2014-11-14 Thread Dale R. Worley
 From: Thanakorn Sathitwitayakul thanakorn.in...@gmail.com
 
 I just install git-1.9.4-preview20140929 on my notebook pc, window 7 64 bit 
 system. When I run git for the first time I got error message;
 
 sh.exe: /dev/null No such file or directory
 
 When I input some command in git, it run not thing but 
 
 fatal error: 
 sh.exe: /dev/null No such file or directory
 
 I do remove git and reinstall in every possible way, choose different 
 option for different attempt, for many time. Then I did google for the 
 solution to the issue that involve sh.exe or /dev/null on the same os 
 environment. I shut down antivirus before install git. I did install git in 
 safe mode. And all of these doesn't fix the problems.
 
 I appreciate any help

Have you checked to see that /dev/null exists on your system?

My understanding is that you can only run Git in a Unix-like
environment.  It appears that whatever provides the Unix-like
environment on your Windows 7 system is not providing /dev/null.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Re: Is it possible to revert the commit in a particular (individual) branch

2014-11-08 Thread Dale R. Worley
 From: Vasily Makarov einmal...@gmail.com
 
 It's not clear what the actual problem is.
 Git doesn't allow you to revert a commit you don't like?
 Or, maybe, you want to revert the merge commit?

Also, what does revert mean?

The head of a branch is simply a pointer (whose name is the branch
name) that points to a particular commit.  You can change that pointer
with git branch -f branch-name commit-hash.  That will revert all
changes to the branch since that commit.

There are more complicated sorts of revert where you don't go back
to a previous commit, but instead remove some of the changes that have
been made in the branch.  These changes shows up in the Git history as
additional commits.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How to remove folder and it's contents from repo

2014-11-04 Thread Dale R. Worley
 From: citm09 tusharme...@hotmail.com

 Currently my repo contains all these _notes folder located under different 
 folders in this tree structure. How do I remove these _notes folder and 
 it's contains. I do not want Git to track these _notes folders and it's 
 contents.

What you need to do is put _notes in the top-level .gitignore file.
That will cause Git to ignore all of the _notes directories.

What I don't know is how to delete the record of the existing _notes
directories from the current commit, without deleting them from the
working tree.  Ah, what you want is git rm --cached -r.  This would
work (if you were on some flavor of Un*x):

git rm --cached -r $( find . -name _notes )

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] how to convince git ls-files to include ALL files in repo?

2014-11-03 Thread Dale R. Worley
 From: Sam Roberts vieuxt...@gmail.com

 Alternatively, there must be a command that gives the path to the root
 of the current .git tree, what is that command? I could use its output
 as an argument to git ls-files...

git rev-parse --show-toplevel

There are several related options; see the manual page.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git ancestor/descendant terminogy clarification

2014-11-03 Thread Dale R. Worley
 From: Vasily Makarov einmal...@gmail.com
 
 Git documentation defines commit ancestry as reachability of one commit 
 from another.
 Formally, this might mean that every commit is ancestor and descendant of 
 itself. 
 I've also checked git merge-base --is-ancestor and found it returns true 
 for same commit passed twice as argument.
 
 This is formal although not so evident detail, and IMO it changes meaning 
 of some git commands/options.
 
 Does anybody have any thoughts on this?

I believe that ancestor and descendant are consistently used in
the inclusive sense, that is, a commit is its own ancestor and
descendant.

If the documentation is not consistent in this use, that needs to be
fixed, because not getting that detail right could cause unpleasant
surprises.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git revision number

2014-10-29 Thread Dale R. Worley
 From: guru prasad gupr1...@gmail.com

 Now my question is if the project version is 1.2.3.4

Git doesn't record version numbers of any sort.  So you have to
store the version number(s) in one or more files, so that the program
that creates the archive file can extract the version number(s) and to
the correct thing with them.

There are probably many ways of doing this.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git objects and user permissions

2014-10-27 Thread Dale R. Worley
 From: Jon Zeolla zeo...@gmail.com

 Nevermind I guess the sticky bit trickles down throughout the whole 
 directory structure.  

Strictly speaking, the default value of the sticky bit when a
directory is created is the sticky bit value of its parent directory.
It trickles down when the directories are created.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git-filter-branch : How to filter all commits from an given commit ?

2014-10-24 Thread Dale R. Worley
 From: Alcolo Alcolo alcol...@gmail.com

 Because C can be a base commit of branches and merges, then it's a 
 nightmare to rebase.
 
 I know that scripts exists to rebase merges (based on git-rev-list, 
 git-cat-file, git-hash-object/git-commit-tree), but those scripts redo the 
 git-filter-branch job.

Actually, git-filter-branch is based on git-rev-list etc.

The purpose of git-filter-branch, though, is to be able to apply a
complicated transformation to every commit in the branch, usually the
uniform removal of particular paths from the file tree.  What you seem
to be wanting to do is modify a commit (although I'm not clear whether
you simply want to change the meta-data or whether you want to also
change the file content), and then have that propagated through all of
the descendant commits (at least in their hashes, and possibly in
their file content).  That job isn't really the purpose of
git-filter-branch, because in what you want, the changes to the
descendant commits are only due to propagatation from the changes in
C.

But why are you, of all people, asking about this?  You've used
git-rebase--merge-safe, which does this sort of task.  You've even
*improved* it.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Combining multiple repositories into one

2014-10-17 Thread Dale R. Worley
 From: Richard Kennaway richard.kenna...@gmail.com
 
 This is an obviously insane arrangement, but never mind how it got like 
 that, it is like that. I would like move from the current state, which is a 
 directory Z containing repositories A, B, C, D, to having a git repository 
 Z, containing directories A, B, C, D.
 
 If I didn't care about preserving history or any but master branches I 
 could just export everything from all the repositories and create a brand 
 new repository. But I do want to preserve history and branches.

One approach that should be workable runs like this.  Unfortunately, I
don't know Git well enough to know exactly the right commands, but if
it does what you want, you can work out how to do it, and probably
write a script that does it fairly automatically.

1. Create a new, empty repository.

2. For each branch that you want to merge:  (That is, you want to combine
branch A.b1 of A, branch B.b1 of B, branch C.b1 of C, etc., into
branch b1 of the new repository.)

3. Import each of the branches into the new repository using
git-fetch.  Give each one a unique branch name in some manner.  This
gets all the needed objects for the new branch into the new
repository's object store.

4. Delete all the files in the working directories of the new
repository and manually assemble the file tree that you want in the
working directories.  If all you want is one directory containing
subdirectories that contain copies of each component branch, this can
be done by script, copying the file trees from the old repositories.
Use git-add to force the index to match the working directories.

5. Use git-write-tree to create a tree object from the index.

6. Use git-commit-tree to create a new commit, giving it the hash of
the tree created in step 5 as the tree pointer, and using multiple -p
arguments to list as parents the hashes of all of the source branches.

7. Use git-update-ref to update the corresponding branch head in the
new repository with the commit created in step 6.

The result is a branch in the new repository whose head commit has the
contents you want, and which lists as parents all of the component
branches you combined to create it.  Presumably the Git commands which
try to track the origins of each file can find which of the parents
each file came from.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Trying to commit to branches from different local folders.

2014-10-17 Thread Dale R. Worley
 From: Martyn Leeper martynlee...@gmail.com

 I'm pretty new to Git. I've managed to do different things like pull, push, 
 fetch, delete, etc to and from Github using Git. I'm wondering, is it 
 possible to making commits (upload) from different local folders (on my 
 computer e.g. C:\Branches\Foo  C:\Branches\Boo) to different Branches on 
 my Github account.
 
 Essentially doing the following:
 
 Foo (Local) - Foo (Github)
 Boo (Local) - Boo (Github)

I describe it this way:

If C:\Branches\Foo and C:\Branches\Boo are two different repositories,
then each of them can upload commits that have been made locally to
the master repository on Github.

If they are part of one repository, what you are asking is if you can
create a commit locally out of the files in directory Foo (part of the
working tree) and then upload that commit to Github.

The central point is that what is uploaded and downloaded are
*commits*.  When a commit is moved, all of the objects that it
references are copied as well (if they aren't already present in the
destination repository).

I believe that you can create a commit in a repository that only
contains the changes made in a specific subdirectory.  You do that by
invoking git-add with a pathspec which is the directory.  It may be
more difficult to add it to a particular branch if it is not the
normal case where the files in the working tree reflect the head of
that branch.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Files are commiting without staging

2014-10-07 Thread Dale R. Worley
 From: John Hite jvh24...@gmail.com

 Is there some config setting that causes my modified files to be
 staged automatically?

Well, if you accidentally used git commit -a, it would do that.  But
there doesn't seem to be a config setting to force that behavior.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Is it possible to git add a set of files as non-text, irrespective of any .gitattributes files?

2014-10-03 Thread Dale R. Worley
 From: Sam Roberts vieuxt...@gmail.com
 
 And that after, its removed, even if the user SIGTERMed your command
 during the add, before the script got to removing the .gitattributes.

One possiblity is to make sure that the temporary files you are
concerned with have names that are disjoint from any non-temporary
files.  Then if .gitattributes gets polluted, it doesn't matter,
because the temporary entries can never affect a non-temporary file.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git add --all --no-binaries

2014-10-03 Thread Dale R. Worley
 From: Constantine Tarasenkov iam...@gmail.com
 
 Wouldn't be cool to have a flag that skips binary files on staging area? 
 I'm pretty sure Git can detect binary files before the commit. Does someone 
 knows other ways not including them automatically?

The trouble is that binary isn't the criterion you want.  Sometimes
binary files are original files in a software distribution.  And
sometimes text files are generated files.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git rev-list --objects doesn't show moves

2014-10-01 Thread Dale R. Worley
 From: Roman Neuhauser neuhau...@sigpipe.cz

 yup, i'd like a plumbing equivalent of `git log --raw ...`.  AFAICT
 the closest to that is git-diff-tree, except that implies N invocations
 instead of one, a sad loss of efficiency i'd love to avoid.

You may be beyond my knowledge here, but if you want to list the
changes that were made to the file-tree by each of a series of
commits, you will pretty much have to do one invocation of diff-tree
for each commit, or something else that is functionally equivalent.
The reason is that there is no stored summary of what is changed by
this commit, the only way to determine that information is to compare
each file reference of each commit with the cognate file reference in
its predecessor commit.  There's no way to do that whose run time is
not proportional to both the number of commits and the number of
files.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Can't clean untracked changes.

2014-09-29 Thread Dale R. Worley
 From: Chris Carter jesdisci...@gmail.com
 
 `git status` showed lines resembling this:
 modified:   subfolder (untracked content)
 
 I found that these commands refused to properly restore me to a pristine 
 state, matching my remote:

I'm no expert, but I'd say it's a design decision:  If Git isn't
supposed to track xyzzy, then it also shouldn't delete it.

The usual way of getting untracked stuff into your working directory
is by compiling things, and the usual way of getting rid of it is
make clean or make distclean.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git on WD My Cloud Drive

2014-09-29 Thread Dale R. Worley
 From: Kevin Brooks bear35...@gmail.com
 
 Has anyone set up a Git repository on a WD My Cloud Drive?  If so I could 
 use some help.

It would be more efficient if you told us what wasn't working as
expected.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git rev-list --objects doesn't show moves

2014-09-29 Thread Dale R. Worley
 From: Roman Neuhauser neuhau...@sigpipe.cz
 
 i'm writing an alternative to git-requet-pull.  its output includes
 a log of the commit range, eg:
 
   1/3 76a23b86 043603cc README fancier
   162441d0 README
   2/3 87990615 ab984c9b ignore vim swapfiles
   32682119 .gitignore
   3/3 2c842d2d 2ab371a4 README is now README.txt
 
 each commit is represented by a line giving its position in the range,
 the treeid, the commitid and the subject line, followed by a series of
 lines identifying affected files, each line with the objectid and path.
 
 i'm gathering the data with `git-rev-list --objects`, but it doesn't
 mention objects that were moved (git mv) in a given commit; this is
 visible in the last (3/3) commit in the example above: that commit was
 just `git mv README README.txt`.
 
 i want the output to identify moves and copies.  what are my options?
 am i missing an option in git-rev-list(1)?  should i use a different
 piece of plumbing?

The fundamental problem is that Git's data structures don't list moves
and copies.  For that matter, they don't list adds and deletes,
either.  As stored, each commit just tells the contents of the
directory tree.  What you appear to want is something that compares
one or more commits and tells what the differences between them are.

OTOH, is that what you *really* want?  You say that you're writing an
alternative to git-request-pull.  What is the definition of this
output?  What purposes do you expect the output to be put to?

For instance, when you're pulling commit 3/3 from the remote, you
don't *need* to download the blob that is the current contents of
README.txt (and the former contents of README) because you already
have it in your repository.  So git-rev-list --objects doesn't list
it.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] removing old history from the archive

2014-09-24 Thread Dale R. Worley
 From: Michael Mossey michaelmos...@gmail.com
 
 I'm very new to git, and so far I'm using it more like a system to back up 
 files and transfer them from computer to computer, no branching or anything 
 complicated yet. In one directory tree, most of my files are binary files, 
 so git can't take advantage of storing only deltas and can't compress the 
 files much. My database size has skyrocketed in the past month as a result. 
 At the moment I really don't need versions of certain files or directories 
 older than, say, 2 weeks. Is there a way to delete old history by that 
 criteria (say anything before a specific date?).

If you're dealing with binary files whose contents change rapidly,
there aren't any good solutions.

I have some Git repositories which I use to track large parts of my
system.  One tracks all the system files.  I only do a commit once a
week or so, but since those files rarely change, the fact that many of
the files are binaries and don't compress well doesn't matter.

For my home directory, I keep a repository I call time warp, which
is somewhat like Apple's Time Machine.  cron does a Git commit every
minute.  But every night I run a cron job to prune it by removing a
subset of the commits.  That requires recreating all of the commits,
because the parents of the commits changes.

There is a rate R, and the goal is that for times that are X minutes
in the past, only keep commits that are spaced X/R minutes apart.  In
this case, I set git config time-warp.rate 365, so commits from two
days ago are pruned to be about 8 minutes apart, while commits from a
year ago are pruned to be about 1 day apart.  In the long run, the
number of commits grows about as the logarithm of how long I've been
running time-warp.

Dale
--
time-warp-prune

#! /bin/perl

use strict;

# Process the switches.

# $debug is the debugging print level.
my($debug) = 0;
# $do_gc is true if git-gc is to be done after pruning.
my($do_gc) = 1;
while ($ARGV[0] =~ /^-/) {
# The -d switch must have a numeric argument.
if ($ARGV[0] =~ /^-d([\d]+)$/) {
$debug = $1;
shift;
}
# The --no-gc switch suppresses the garbage collection afterward.
elsif ($ARGV[0] eq '--no-gc') {
$do_gc = 0;
shift;
}
# Handle unknown options.
else {
die Unknown option: ', $ARGV[0], '\n
}
}
# Handle unknown arguments.
die Unknown argument(s): , join(' ', @ARGV) if $#ARGV = 0;
if ($debug) {
print STDERR \$debug = $debug\n;
print STDERR \$do_gc = $do_gc\n;
}

# This is the rate at which commits are to be retained:
my($rate);
# At a time N in the past, commits should be spaced at most N/$rate
# apart.
# Thus, larger $rate values mean to keep more commits around.
# The rate is stored in the Git configuration as time-warp.rate.
# If the user entered it on the command line, it would be easier for
# the user to fumble-finger a small value and delete much of the
# history he wanted to save.
my($config_name) = 'time-warp.rate';
my($command) = 'git config ' . $config_name;
chomp($rate = `$command`);
my($r) = $?  8;
if ($r != 0) {
warn Could not obtain Git configuration value '$config_name'.\n;
die Error executing '$command': exit code $r\n if $r;
} elsif (!($rate =~ /^\d+$/  $rate = 1)) {
die Rate value '$rate' is syntactically incorrect or less than 1.\n;
}
print STDERR \$rate = $rate\n if $debug;

# Get the hashes and times of the commit history.
# Note that we are assuming that the current branch of the repository
# is the branch to be operated upon.
$command = git log --pretty=tformat:'%H %ct';
print STDERR \$command = $command\n if $debug = 3;
open(GIT, -|, $command) ||
die Error executing '$command' for input: $!\n;
# Note that git log lists commits going back in time, so @hashes and @times
# will describe the latest commits first.
my(@hashes, @times);
while (GIT) {
chomp;
my($hash, $time) = split;
push(@hashes, $hash);
push(@times, $time);
print STDERR \$hashes[, $#hashes, ] = $hash, \$times[, $#times, ] = 
$time\n if $debug = 2;
}
close GIT || die Error closing '$command': $!\n;

# Get the now time, which is the time of the last commit.
my($now) = $times[0];
print STDERR \$now = $now\n if $debug;

# Now, working from oldest to newest, look at each commit and decide whether
# to recreate it.
# The last commit we've recreated and its time.
my($last_commit) = '';
my($last_commit_time) = 0;
my($commits_created) = 0;
print STDERR \$last_commit = $last_commit, \$last_commit_time = 
$last_commit_time\n
if $debug;
# Cycle through the commits from the oldest to the newest, recreating
# the commit chain, retaining the commits we desire.
for (my $i = $#hashes; $i = 0; $i--) {
print STDERR \$i = $i, \$hashes[$i] = $hashes[$i], \$times[$i] = 
$times[$i]\n
if $debug;
# Test if commit $i-1 (the next-newer commit than this 

Re: [git-users] Sort specific hash ids in reverse chronological order..

2014-09-22 Thread Dale R. Worley
 From: Kumar bitraki...@gmail.com

 I've got C, F, Z , Y to revert.  I need to have the recent id first, like 
 Z, Y, F, C so that the revert is correct and smooth.  

It looks like you can use git log -1 hash to find the date of each
hash.  Then use those to sort the hashes in time-order.  To automate
that, you'll probably have to construct a custom output format for
git-log.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git replace

2014-09-17 Thread Dale R. Worley
 From: Alcolo Alcolo alcol...@gmail.com

 My job is done!
 I don't need git replace any more !

Ah, great!

I've integrated your changes into my copy.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Delete all commits starting from a given commit

2014-09-17 Thread Dale R. Worley
 From: Simon Joseph Aquilina simonjaquil...@gmail.com

 The change was successful. However all previous commits still exist. In 
 other words for each commit with the wrong name / email I have another 
 commit with good name / email.
 
 Is there a way how I can delete the old (those containing wrong name / 
 email) commits? 

Do these commits still show in the history of HEAD?  If the procedure
is correct, they shouldn't.  I'd expect that old, unreferenced commits
will eventually be garbage-collected.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git replace

2014-09-15 Thread Dale R. Worley
 From: Alcolo Alcolo alcol...@gmail.com

 My git history is complex and it's a nightmare to rebase from old commits.

I'm not sure what you're attempting to do, but this might help.  It's
a rebasing script I wrote.  It appears that it was based on something
Junio wrote.  The concept is that it rebases the current branch, but
unlike the standard git-rebase, it replicates the merging structure
between the merge-base commit and the head of the branch.  (IIRC, the
standard git-rebase creates a linear branch based on some ordering of
the commits in the old branch.)

Dale
--
#!/bin/bash
#
# Copyright (c) 2010 Junio C Hamano.
# Modified by Dale R. Worley.

# Usage:  git-rebase--merge-safe onto
#
# Rebase the current branch to commit/branch onto, replicating the commit
# graph between HEAD and the merge base.

. git-sh-setup

prec=4

set -ex

# Ensure the work tree is clean.
require_clean_work_tree rebase Please commit or stash them.

onto_name=$1
onto=$(git rev-parse --verify ${onto_name}^0) ||
die Does not point to a valid commit: $1

head_name=$( git symbolic-ref HEAD )
orig_head=$(git rev-parse --verify $head_name) ||
exit 1

echo onto=$onto
echo head_name=$head_name
echo orig_head=$orig_head

# Get the merge base, which is the root of the branch that we are rebasing.
# (For now, ignore the question of whether there is more than one merge base.)
mb=$(git merge-base $onto $orig_head)
echo mb=$mb

# Get the list of commits to rebase, which is everything between $mb and
# $orig_head.
# Note that $mb is not included.
revisions=`git rev-list --reverse --ancestry-path $mb..$orig_head`
echo revisions=$revisions

# Set up the list mapping the commits on the original branch to the commits
# on the branch we are creating.
# Its format is ,old-hash1/new-hash1,old-hash2/new-hash2,...,.
# The initial value maps $mb to $onto.
map=,$mb/$onto,

# Export these so git commit can see them.
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE

# Process each commit in forward topological order.
for cmt in $revisions
do
# Examine the commit to extract information we will need to reconstruct it.
# First parent of the commit that has a mapping, i.e., is part of the
# branch (and has thus been rebuilt already.
first_mapped_parent=
# The new commit that was made of $first_mapped_parent.
first_mapped_parent_mapped=
# List of -p options naming the parent commits, or their new commits if they
# are in the branch.
parents=
# Dissect the old commit's data.
# Output the commit data into FD 3.
exec 3 ( git cat-file commit $cmt )

while read keyword rest 3
do
case $keyword in
tree)
# Ignored
;;
parent)
# See if the parent is mapped, i.e., is in the
# original branch.
if [[ $map == *,$rest/* ]]
then
# This parent has been mapped.  Get the new commit.
parent_mapped=${map#*,$rest/}
parent_mapped=${parent_mapped%%,*}
if test -z $first_mapped_parent
then
first_mapped_parent=$rest
first_mapped_parent_mapped=$parent_mapped
fi
else
# This parent has not been mapped.
parent_mapped=$rest
fi
# $parent_mapped is a parent of the new commit.
parents=$parents -p $parent_mapped
;;
author)
# Extract the information about the author.
GIT_AUTHOR_NAME=${rest%% *}
GIT_AUTHOR_EMAIL=${rest##* }
GIT_AUTHOR_EMAIL=${GIT_AUTHOR_EMAIL%% *}
GIT_AUTHOR_DATE=${rest##* }
;;
committer)
# Ignored:  The new commit will have this user's name
# as committer.
;;
'')
# End of fixed fields, remainder is the commit comment.
# Leave contents of FD 3 queued to be read later by
# git commit-tree.
break
;;
*)
# Ignore all other keywords.
;;
esac
done

echo GIT_AUTHOR_NAME=$GIT_AUTHOR_NAME
echo GIT_AUTHOR_EMAIL=$GIT_AUTHOR_EMAIL
echo GIT_AUTHOR_DATE=$GIT_AUTHOR_DATE
echo parents=$parents
echo first_mapped_parent=$first_mapped_parent
echo first_mapped_parent_mapped=$first_mapped_parent_mapped

test -n $first_mapped_parent || exit 1

# Do the three-way merge.
# Empty the index so git read-tree will merge into it.
git read-tree --empty
git read-tree -m --aggressive \
$first_mapped_parent $cmt $first_mapped_parent_mapped
git merge-index git-merge-one-file -a

# Construct

Re: [git-users] git replace

2014-09-12 Thread Dale R. Worley
 From: Alcolo Alcolo alcol...@gmail.com

 There is a way to remove all old replaced commits for ever ?

git gc --aggressive works, but you have to purge all the recorded
references to old commits.  The ones I know of are:

You have to set core.logallrefupdates to 'false' to prevent logs from
containing references, and gc.pruneexpire to 'now'.  And many scripts
that rewrite history leave the old head value in refs/original/..., so
you have to do something like:

git update-ref -d refs/original/refs/heads/$BRANCH

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Identify added/changed lines since a specific commit

2014-09-09 Thread Dale R. Worley
 From: gituser konrad.j...@googlemail.com
 
 I am wondering if it's possible to determine if a specific line in the code 
 (of the curent version of a file) was added or changed after a specific 
 commit?

Of course, the question is not perfectly well-defined, because there
is no absolute definition of what constitutes a specific line of a
file and all of its ancestors.  (E.g., consider a line containing a
solitary close brace.)  But it seems like an easy way to get a
reasonably good answer is to run git-blame

git-blame - Show what revision and author last modified each line of a file

and see what it notes as the last change.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] linking/sync individual files from different folders in the same repo

2014-09-04 Thread Dale R. Worley
 From: Norike Abe nor...@gmail.com

 I'm studying the migration from our old Version Manager, Team Coherence 
 http://www.teamcoherence.com/, to Git.
 
 One of the features we use in that system are file links:
 Imagine a repo with this file structure:
 - MyRepo1
   - Folder1
 - *FileA*
 - FileB
   - Folder2
 - *FileA*
 - FileC
 
 I want FileA from both Folder1 and Folder2 to be synchronized.

What I don't see is why you'd want to have what is intended to be one
file implemented by two different files.  That requires some sort of
machinery to ensure that the two instances of the file are always the
same, and introduces the constant possiblity of error.

One way to avoid this is to have one FileA be a symbolic link to the
other.  But I suspect you're using Windows, and it doesn't have
symbolic links.

Another way is to just tell every compilation and/or program that
wants to access FileA the location of the one copy of FileA.  Indeed,
the fact that the stuff in each folder wants to access the same file
suggests that the meaning or import of FileA transcends the specifics
of either Folder1 or Folder2.

The migration to Git might be the opportunity to rationalize your file
structure.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Confusion about Key-based SSH authentication

2014-09-03 Thread Dale R. Worley
 From: Xavier Yin wonderera2...@gmail.com
 
 Hi, every one!
 
 I recently read Git on the Server - Setting Up the Server 
 http://git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-Server, I 
 have a confusion about this paragraph as below:
 
 
 Key-based SSH authentication usually enforces security by requiring 
 restricted rights on the involved files. To prevent SSH from refusing to 
 work, type this:
 
 $ chmod -R go= ~/.ssh
 ---

I don't know exactly what causes your issue, and I am not an expert in
SSH.  But I do know that the SSH server daemon enforces certain
restrictions on the permissions of the files in ~user/.ssh.  For
security it is important that no-one other than the user can read any
of the private key files.  Similarly, it is important that no-one
other than the user can modify any of the files in .ssh.  When a
client tries to authenticate as the user, the SSH daemon verifies that
the files in ~user/.ssh meet these requirements, and if they do not,
the daemon refuses the connection.  Probably the easiest way to ensure
that the .ssh directory meets these requirements is the chmod command
listed above.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Confusion about Key-based SSH authentication

2014-09-03 Thread Dale R. Worley
 From: Konstantin Khomoutov flatw...@users.sourceforge.net

 Directory/file insecurities related to SSH on the server are typically
 logged appropriately (on a stock Debian-based system that will
 be /var/log/auth.log).

On Fedora, it looks like they go into either /var/log/messages or
/var/log/secure.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git and filename case sensitivity

2014-08-27 Thread Dale R. Worley
 From: Konstantin Khomoutov flatw...@users.sourceforge.net

 What I'm leading you to, is that, IMO, trying to fight this behaviour
 relied upon by so many pieces of software is counter-productive except
 for very special and isolated cases.
 So I'd rather fix the project you're working on to have portable
 filenames (say, all_lowercase or ConsistentlyCamelCased etc).

My observation is that even if you're working on Unix (which
consistently distinguishes filename case), it's asking for trouble to
have two files whose names only differ by case -- the computer is
case-sensitive, but *humans* are not consistently case-sensitive.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git rebase command!

2014-08-27 Thread Dale R. Worley
 From: Gopi Naidu chgopina...@gmail.com
 
 getting the issue with git rebase command on HPIA machine
  
 bash-4.0$ git version
 git version 2.0.4
 bash-4.0$ uname -a
 HP-UX machine-name B.11.31 U ia64 1660207278 unlimited-user license
 bash-4.0$ git rebase
 fatal: Uh oh. Your system reports no Git commands at all.
 bash-4.0$
  
 please help

The git-rebase operation is actually done by a program named
git-rebase, which the git program runs.  On my system, git-rebase
is in /usr/libexec/git-core/git-rebase.  The message strongly suggests
that git cannot find git-rebase on your system.

You can probably find where your git-rebase is with the command
locate -b git-rebase, since you seem to be running a Unix-type
system.

I don't know how git finds its sub-programs.  It is not done through
PATH because /usr/libexec/git-core is not in my PATH.  You probably
have a git-rebase program, but some configuration needs to be
adjusted so that git can find it.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] strange histories from git filter-branch

2014-08-26 Thread Dale R. Worley
 From: Bernard Clark berniecla...@gmail.com
 
 I've been running the git filter-branch described here 
 http://stackoverflow.com/questions/14759345/how-to-split-a-git-repository-and-follow-directory-renames.
 . But the resulting history includes at least two extraneous commits, i.e., 
 commits that appear to affect no files in the subdirectory of interest. 
 (The corresponding commits in the original history do affect files, but 
 those files are in another subdirectory.)

My guess is that the inner script doesn't correctlty notice that one
of the old commits, when limited to the subdirectory, doesn't change
anythihng, and does not signal to the wrapper that no new commit needs
to be created.

(H, that could be messy if the old commit was a merge commit,
because you'd need a new commit to record the merge, even if no file
is changed (relative to one parent).)

 I also noticed the occurrence of several duplicate parent errors during 
 the git filter-branch. This page 
 http://stackoverflow.com/questions/15161809/git-duplicate-parent-causes-half-the-history-to-to-disappear
  
 says that those errors can produce an incomplete new history, so I'm now 
 wondering if, in addition to including extraneous commits, my new history 
 might also be missing some. Along with this page 
 http://stackoverflow.com/questions/7489713/git-duplicate-parent/7501703#7501703,
  
 the page says that the duplicate parent errors should disappear if git 
 filter-branch is first run with no filter. But that didn't work for me.
 
 Thoughts?

It could be messy -- as you create new commits, sometimes two old
commits will map into identical new commits.  If filter-branch notices
that, it might wind up giving that one new commit twice as parents of
a new commit.  Does filter-branch have a strategy for dealing with
that?

I'd sit down and draw a diagram of what the new commit structure
*should* look like, together with the mapping from the old commits,
and then see whether filter-branch's output matches what you expect.
That should show you the specific situations that are causing the
problem, and may allow you to deduce how filter-branch is handling
them.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] What happens when the repository is bigger than gc.autopacklimit * pack.packSizeLimit?

2014-08-26 Thread Dale R. Worley
A number of commands invoke git gc --auto to clean up the repository
when there might be a lot of dangling objects and/or there might be
far too many unpacked files.  The manual pages say:

git gc:
   --auto
   With this option, git gc checks whether any housekeeping is
   required; if not, it exits without performing any work. Some git
   commands run git gc --auto after performing operations that could
   create many loose objects.

   Housekeeping is required if there are too many loose objects or too
   many packs in the repository. If the number of loose objects
   exceeds the value of the gc.auto configuration variable, then all
   loose objects are combined into a single pack using git repack -d
   -l. Setting the value of gc.auto to 0 disables automatic packing of
   loose objects.

git config:
   gc.autopacklimit
   When there are more than this many packs that are not marked with
   *.keep file in the repository, git gc --auto consolidates them into
   one larger pack. The default value is 50. Setting this to 0
   disables it.

What happens when the amount of data in the repository exceeds
gc.autopacklimit * pack.packSizeLimit?  According to the
documentation, git gc --auto will then *always* repack the
repository, whether it needs it or not, because the data will require
more than gc.autopacklimit pack files.

And it appears from an experiment that this is what happens.  I have a
repository with pack.packSizeLimit = 99m, and there are 104 pack
files, and even when git gc is done, if I do git gc --auto, it
will do git-repack.

Looking at the code, I see:

builtin/gc.c:
static int too_many_packs(void)
{
struct packed_git *p;
int cnt;

if (gc_auto_pack_limit = 0)
return 0;

prepare_packed_git();
for (cnt = 0, p = packed_git; p; p = p-next) {
if (!p-pack_local)
continue;
if (p-pack_keep)
continue;
/*
 * Perhaps check the size of the pack and count only
 * very small ones here?
 */
cnt++;
}
return gc_auto_pack_limit = cnt;
}

Yes, perhaps you *should* check the size of the pack!

What is a good strategy for making this function behave as we want it to?

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] Making repacking faster

2014-08-26 Thread Dale R. Worley
I've got a Git repository that I use to log updates to system files.
Not things in /var that change every day, but configuration files in
/etc, binaries in /usr, etc.  Of course, the repository is large, 9 or
10 GB now.

I've just discovered that setting core.bigFileThreshold = 10k speeds
up garbage collection and repacking tremendously, like from 9 hours to
1/2 hour.  This works well in this situation, because files that are
larger than 10k are almost all binaries, and don't benefit from delta
compression.  And it turns out that delta compression takes a lot of
time if you have a lot of data.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Review changes in a concrete line of code

2014-08-19 Thread Dale R. Worley
 From: Norike Abe nor...@gmail.com
 
 Is there a command to compare all the changes between two given commits a 
 file has suffered, in a given set of lines of code?

There are a number of Git commands to investigate problems like this,
including git blame and git diff.

A tool that I use is git-history, which is a script to extract all
of the versions of a file that are contained in the current branch.
Once you have all versions of a file, you can use regular Unix tools
to determine many things about the history of the file.

Dale
--
#! /bin/bash

# Get the historical versions of a file.

# First argument is the path of the file in question.  It is
# interpreted as GIT interprets path arguments.
# Historical versions of the file will be extracted as
#basename.-mm-ddThh:mm:ss
# in the current directory, where the time is when git log notes the
# file (which I think is the first occurrence of that file content).
# The time is shown in the current local timezone.

FILE=$1
BASENAME=${FILE##*/}

git log --pretty=tformat:%H %ci --date=local -- $FILE |
while read HASH DATE TIME ZONE
do
R=( $( git ls-tree --full-tree $HASH $FILE ) )
if [[ -n $R ]]
then
NAME=$BASENAME.${DATE}T${TIME}
echo Creating $NAME...
git cat-file -p ${R[2]} $NAME
fi
done
--

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git clone fails when invoked with python/php scripts.

2014-08-17 Thread Dale R. Worley
 From: Vaibhav Chauhan vaibhav@gmail.com
 
 I am trying to clone a git repo when running git clone command when run as 
 www-data, an apache user, it fails with* **git clone -v 
 ssh://git.***.com/home/repo/qa/morrison-test/common.git 
 /tmp/tempGit_1408125949.48' returned exit status 128: ssh: Could not 
 resolve hostname git.blurdev.com: Name or service not known.*. As a matter 
 of fact when I am running the same python script locally I am able to clone 
 it flawlessly.
 
 Can someone take a look at the question at 
 http://stackoverflow.com/questions/25317557/python-script-fails-to-git-clone-when-run-with-php

One thing to do is create a PHP page that just executes the 'git
clone' command.  That simplifies the situation by eliminating the
Python program around it.

Another is to have a page output all of the permission information.
On my system (Fedora 19), the plain id command shows all the uid/gid
information, as well as the SELinux context.

Then you can get on the server in question, su to the right account,
execute the commands to set up *exactly* the same permission state,
and execute the 'git clone' manually.

Another approach is to run Wireshark on the server and watch the
connection to git.*.com fail.  Although I'm not sure what you need to
do to be able to see what's going on inside the SSH connection.
(Perhaps there is a way to set the account's ~/.ssh/config options to
force it to use the null cipher?

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] issues with downloading project files from git

2014-08-17 Thread Dale R. Worley
 From: John McKown john.archie.mck...@gmail.com
 
 Try
 
 git clone https://github.com/laravel/laravel.git
 
 It works for me.
 
 The command you used looks more like it is only for the owner. The form
 g...@github.com:laravel/laravel.git looks more like what I use when I'm
 updating my own repositories, not cloning somebody else's repository.

Hmmm, yes.  Syntaxes like u...@host.com:path usually mean log in as
'user' onto host 'host.com' and then access the file identified by
'path'.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Problem with commit

2014-08-15 Thread Dale R. Worley
 From: DavidFreed dabbaghi...@gmail.com
 
 Dear Friends,
 I have this problem with Git , please advice me.
 
 git commit -am commit all

Please tell us what you do not like about Git's behavior.

This will give you some advice:
http://www-mice.cs.ucl.ac.uk/multimedia/software/documentation/ReportingBugs.html

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] repo init not working in GIT BASH

2014-08-08 Thread Dale R. Worley
 From: scmmanage scmman...@gmail.com

 $ repo init
 sh.exe: /c/Users/vikram.sadasivam.LGE/bin/repo: /usr/bin/env: bad 
 interpreter:
 Permission denied
 
 Please do ask me if anything I left out.

It has something to do with an executable file that is organized as an
interpreter script (an intro at
http://en.wikipedia.org/wiki/Pound_bang) which specifies
/usr/bin/env as the interpreter.  /usr/bin/env (on your system) is
either not present, or you are for some reason not allowed to execute
it as a program.

If I read the message correctly,
/c/Users/vikram.sadasivam.LGE/bin/repo (which is probably the same as
C:\Users\vikram.sadasivam.LGE\bin\repo) is the executable file in
question.

My guess is that /usr/bin/env on your system does not designate an
installed file.  I don't know what you need to do to obtain that file.

Do you know that repo can be installed and run on Windows?

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Re: Submodul with push

2014-07-28 Thread Dale R. Worley
 From: Pierre-François CLEMENT lik...@gmail.com

 I don't see any other option than chaining your commands by joining them 
 with ** (or *;* if you want each command to be executed even if one of 
 them fails, but I doubt it).
 
 $ git clone --recursive myproject  cd mainproject/submodule1  touch 
 test.txt  git add test.txt  git commit  git push

For a very long sequence of commands, it might be a bit easier to do:

$ ( set -e 
git clone --recursive myproject
cd mainproject/submodule1
touch test.txt
git add test.txt
git commit
git push
  )

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] Finding and eliminating big files

2014-07-21 Thread Dale R. Worley
Here's an improved version of the script that finds what refs and what
commits contain a particular file blob.  You give it the blob (the
full blob) as an argument and it traces what commits contain it, and
what refs and what reflog lines point (directly or indirectly) to
those commits.

As far as I can tell, it's correct, but I haven't paid any attention
to efficiency.  On my computer, it takes about 15 minutes to search a
clone of the Git repository.

Following is the script and an example of its use.  No doubt it can be
improved significantly.

Dale
--
#! /bin/bash

# git-find-blob - Find a given blob, given its hash.

BLOB=${1:?First argument is the blob hash.}

# Temporary file name base.
T=${TMPDIR:-/tmp}/${0##*/}.$$

# Make a copy of stdout, since we will be redirecting stdout within the script.
exec 31

# Find the commits in which the blob exists.

# List all commits.
git rev-list --all |
while read COMMIT
do
# COMMIT_ADDED records whether this commit hash has been stored or not.
COMMIT_ADDED=no
# List all files within the commit.
git ls-tree --full-tree $COMMIT |
while read MODE TYPE HASH NAME
do
# If this file matches the blob, report it.
if [ $HASH = $BLOB ]
then
echo 3 Commit $COMMIT Name $NAME
if [ $COMMIT_ADDED = no ]
then
# Send the commit onward.
echo $COMMIT
COMMIT_ADDED=yes
fi
# Beware that the same blob may appear multiple times, so we
# have to continue searching through this tree.
fi
done
done $T.commits

# Find the refs that lead to the commits.

# Both of the following functions produce lines of the form:  hash ref-name

# A function to list all of the refs.
function all_refs () {
git show-ref
}

# A function to list all of the entries in all of the reflogs.
function all_reflogs () {
# Go to the .git/logs directory and find all the reflog files.
cd $( git rev-parse --git-dir )
find logs -type f |
while read REFLOG
do
# Read each reflog file.
LINE=1
cat $REFLOG |
while read BEFORE AFTER DATA
do
# Turn every line into two lines:  hash reflog-name
echo $BEFORE $REFLOG:$LINE
echo $AFTER $REFLOG:$LINE
(( LINE++ ))
done
done
}

# List all the refs.
( all_refs ; all_reflogs ) |
while read COMMIT REF
do
# Skip the null commit if it shows up.
[ $COMMIT =  ]  continue

# REF_ADDED records whether this ref has been stored or not.
REF_ADDED=no
# List all the commits in the ref that contain the blob.
git rev-list $COMMIT |
grep -f $T.commits |
while read COMMIT
do
echo 3 Commit $COMMIT Ref $REF
if [ $REF_ADDED = no ]
then
# Send the ref onward.
echo $REF
REF_ADDED=yes
fi
done
done $T.refs

# Write out the refs.
$T.refs sort -u |
sed -e 's/^/Ref /'
--
$ time git-find-blob 07c2aba4f2c2434551a436d626447902f0c1872d
Commit fee106fafa1a9ee6029ad6390a7404f66b10d656 Name Makefile
Commit bd6350770e454c0bdef312419289ef6e0ba6bc81 Name Makefile
Commit f7c69c45befd9772282f1d45e988d5f62f54696b Name Makefile
Commit f918f7b13d09fbb93c2892899f680da80ed51ac1 Name Makefile
Commit 771a1a04e6c038cf974123b2303baccf5dfc4e98 Name Makefile
Commit cf5a8e3c1f4571f3a9daf59537026a2700e1f5ce Name Makefile
Commit ad158af1429bb1283f1605245b941699d3d1bc7b Name Makefile
Commit c9a507c3b8072891c5ce164ac82e8009d20c9b1f Name Makefile
Commit bf7b47d405b5f7e72058157df3b18e840ce4d0ac Name Makefile
Commit b3f76e372d66e61c06bc28def35b2e991a0692e1 Name Makefile
Commit 05ef0f3cf0cb7a398b552d61325898bc72da818c Name Makefile
Commit 9e6c9b4ee355cec3f7f48758107300d6daca34ae Name Makefile
Commit b0b86cfed2094c983b41a926d74e313f220d7e58 Name Makefile
Commit 6f128b42fb40916e4b9c233557bdde5a7b90c86a Name Makefile
Commit bcf3cbc25b543e485bfab373ef9852f5a67bee43 Name Makefile
Commit a77e57b2054683340bcf0dc0dd717e2b559d97d0 Name Makefile
^- meaning that in these commits, at the indicated file name, is a
   file with hash 07c2aba4f2c2434551a436d626447902f0c1872d
Commit fee106fafa1a9ee6029ad6390a7404f66b10d656 Ref refs/remotes/origin/pu
Commit bd6350770e454c0bdef312419289ef6e0ba6bc81 Ref refs/remotes/origin/pu
Commit f7c69c45befd9772282f1d45e988d5f62f54696b Ref refs/remotes/origin/pu
Commit f918f7b13d09fbb93c2892899f680da80ed51ac1 Ref refs/remotes/origin/pu
Commit 771a1a04e6c038cf974123b2303baccf5dfc4e98 Ref refs/remotes/origin/pu
Commit cf5a8e3c1f4571f3a9daf59537026a2700e1f5ce Ref refs/remotes/origin/pu
Commit ad158af1429bb1283f1605245b941699d3d1bc7b Ref refs/remotes/origin/pu
Commit c9a507c3b8072891c5ce164ac82e8009d20c9b1f Ref refs/remotes/origin/pu
Commit 

[git-users] Finding and eliminating big files

2014-07-21 Thread Dale R. Worley
Here is how I find big files that have gotten into the repository.
The shell script grovels through the repository history listing every
file in every commit in the history of HEAD, along with its length.
Duplicates are removed from this list, and then a space-use analysis
is done of the files, grouping them by the directories they are
recorded within.  The output graph shows how much space is attributed
to each directory and file, with output for small directories and
files suppressed.

The script is crude in that it doesn't take into account space that is
saved by compression, either of a file individually or multiple
similar files in a pack file.  It also doesn't notice if identical
files are stored under different names in different commits.  But it
works well enough for finding that gigabyte file that has crept into
the respository.

Once you've obtained the blob hash, you can use git-find-blob to
determine exactly how it is referenced.

Dale
--
#! /bin/bash

# git-space-use
# List a tree showing the space breakdown of all the different files
# in all commits.

# Generate all the commit identifiers.
git rev-list --all |
# Process each commit.
while read COMMIT
do
# List all the files in the commit, with their lengths.
git ls-tree --full-tree -l -r $COMMIT |
while read MODE TYPE HASH LENGTH NAME
do
# Output a line like 'du' would make.
echo $LENGTH$'\t'./$NAME/$HASH
done
done |
# Remove duplicate mentions of the same file with the same contents.
sort -u -nr | tee ${TMPDIR:-/tmp}/${0##*/}.$$ |
# Assemble a space-use graph.
dugraph -c
--
/* dugraph.c - program to make a pretty graph out of a du report */

/* Option -c forces the sizes of directories with listed children to be
   calculated from the sizes of the listed children.  This helps if the
   input du listing has had subtrees chopped out of it (for instance, if
   they really reside on other filesystems than the root of the tree), but
   generally requires a -a listing to give sensible results, otherwise the
   calculated size for a directory containing subdirectories will ignore
   the files contained directly in the directory. */

/* Must be compiled with gcc rather than g++, because the types of function
   arguments are given in the old style. */

/* Define I64 to use unsigned 64-bit integers for sizes and totals. */
#define I64

#ifdef I64
  #define SIZE uint64_t
  /* In C99, uint64_t is defined in stdint.h. */
  #include stdint.h
  /* Get the macro PRIu64 which is the modifer-and-format-letter for uint64_t. 
*/
  #define __STDC_FORMAT_MACROS
  #include inttypes.h
#else
  #define SIZE unsigned long int
#endif

#include stdio.h
#include stdlib.h
#include string.h

/* number of lines the listing should occupy */
int length = 60;
/* message for suppressed directories */
#define SUPPRESSED  (etc.)

/* format of a tree node */
struct node {
struct node *lson;  /* left son */
struct node *rbrother;/* right brother */
SIZE   size;   /* size of directory in kbytes */
SIZE   cum_size;/* size of everything listed before
 * this directory */
int loc;/* location we will print it at */
int print_col;/* column to print name in */
int print_limit;
/* location we can't print on or
 * after */
int last;   /* are we last son of our father? */
charname[1];/* name */
  };

/* root of the tree */
struct node *root = NULL;
/* total size of things listed */
SIZEtotal_size;
/* current line number we are on (0-origin) */
int current_line = 0;
/* list of where to put bars */
int bar_list[50];
/* number of bars in the list */
int bar_count = 0;
/* set to force recalculation of sizes of directories */
int calculate_sizes = 0;

/* declare functions */
voidread_input();
struct node *insert_in_tree();
voiddfs();
voiddfs1();
voidmissing_sizes();
voidcalc_cum_size();
voidsort();
voidcalc_loc();
voidblank();
voidmark_last();
voidcalc_pc();
voidoutput();
voidposition();

int main(argc, argv)
 intargc;
 char   **argv;
{
struct node *t; /* scratch */

/* process the options */
if (argv[1] != NULL  strcmp(argv[1], -c) == 0)
{
calculate_sizes = 1;
}

/* read the input and form a tree */
read_input();
root-size = 0;
/* put sizes on entries that have none */
dfs(NULL, missing_sizes);
/* sort each directory */
dfs(sort, NULL);
/* calculate cumulative size before each entry */

Re: [git-users] Re: Git and binary files ... once more

2014-07-17 Thread Dale R. Worley
 From: Dominik Rauch dominik.rauch@gmail.com

 (c) the estimated upper limits to work with a repository in reasonable time 
 on a normal machine (i.e. if my repository reaches 20GB and all of a 
 sudden it takes five minutes per commit, etc.)

Most of the cases where this sort of behavior is seen come from
thrashing, where the memory demand of the program exceeds the
available memory.  So you can look for these problems in advance by
asking What situations cause Git to consume a great deal of memory?

 From: Konstantin Khomoutov flatw...@users.sourceforge.net

 1) Git always compresses objects it writes; and after a certain
threshold it compacts loose object files into the so-called
packfiles which are big indexed archives.
 
What matters is that all these [de]compression operations are
performed in core -- that is, a file is slurped in, operated upon
then written out.  So you ought to have enough free physical memory
to do all of that.

However, you can limit the size of the pack files that Git will
generate through configuration:

[pack]
packSizeLimit = 99m

There may be ways to force Git to not attempt to compress files that
are above a certain size.

Doing that will probably eliminate most situations where Git attempts
to consume excessive memory.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Remove files and folders permanently from commit history and pack files

2014-07-16 Thread Dale R. Worley
 From: cemico webmas...@cemico.de
 
 How do i remove let's say a concept_art folder from all commits (i have 
 about 50 commits by now) and from the pack file?
 
 I tried many things now. e.g:
 - http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/
 - http://rtyley.github.io/bfg-repo-cleaner/
 - filter-branch with rm
 - git gc with prune=now and aggresive
 
 and the thing i thought which must really work:
 http://git-scm.com/book/en/Git-Tools-Rewriting-History#The-Nuclear-Option:-filter-branch

First, be aware that what you want to do is intrinsically difficult.
Git is oriented toward allowing you to manipulate commits, etc.  But
removing objects from storage is not a task that it is designed to
make easy.  I have had a little experience and I think I can provide
some useful guidance.

You already know how to recreate all your commits with certain
directories or files removed:

git filter-branch --index-filter $SCRIPT HEAD

You also know how to remove a stored object if it is no longer
referenced:

git gc --aggressive --prune=now

What is difficult is ensuring that you have removed all references to
the object.  In general, this involves removing records of past states
of the HEAD, and there are a lot of those records.  You have to remove
the record of the previous version of the branch you are manipulating.
(You have to do this before git-filter-branch, so that
git-filter-branch actually runs, and after it, to remove the value
that git-filter-branch put there.)  Your command looks to me like it
should suffice:

rm -rf .git/refs/original/

Where I think you have a problem is with the reflog.  In the
repository on which I use git-filter-branch, I have configured

git config core.logallrefupdates false

To ensure that no reflog entries are generated.  In your case, you use

git reflog expire --all

But as far as I can tell from the manual page, that means examine all
reflogs to find expired entries.  You probably need to add
--expire=now so that all entries are considered expired.

You can probably examine .git/logs to see if there are any reflog
entries, and what their values are.  My suspicion is that one value
points to a commit that points to the files you want to excise.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How did I make this mess?

2014-07-10 Thread Dale R. Worley
I'm hardly an expert, but what I see for the description of the 9:11
commit (5f5345a) is Merge branch 'master' of https://github.com...;.
First question is, What is the full name of that commit?  Second
question is, does the full URL in that commit make sense in the
context of your work?

I'd guess that the Pull that you did merged your working copy with all
those commits from github, and the Push sent it to your master.  Are
you sure that the connections from your working copy to the master are
set up correctly?  And it git-pull the command you really want?

Do you have some sort of log that shows exactly what Git commands you
executed?

I expect that you can reset the HEAD and contents of your working copy
to the parent of 7f78507, re-apply your changes for that commit, and
re-execute the Pull and cause the problem to happen again.  Then look
at the commit history of your working copy.  Heh -- do this in a copy
of your working copy, not the live one.

Dale

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   >