« first day (3744 days earlier)      last day (1202 days later) » 

7:05 AM
Hi @Fabby. Sorry I missed you. Again.
@Fabby I see it. Thanks. I'll ping you.
 
7:31 AM
Is it safe to say that I can run the command rsync -avv --inplace --no-whole-file "$1" "$destDir" and rsync will try to copy only the file that failed to copy because of an input/output error?
This would use rsync's delta-transfer algorithm and since only one file (i.e. file.pdf) failed to copy, only the file that failed to copy should be transferred. I don't think --inplace` is necessary here as there is no existing file. As for --no-whole-file, if I use --whole-file instead, will it still be only the file.pdf file that failed to copy that will be transferred except that the whole file will be transferred.
Basically, I want to confirm whether rsync -avv --inplace --no-whole-file "$1" "$destDir" command will only transfer the (whole) file.pdf file? I think I can use rsync to manually copy that single file, but I want to rerun the script which contains rsync -avv --inplace --no-whole-file "$1" "$destDir" with any necessary modifications to the rsync command in the script.
 
 
3 hours later…
10:47 AM
@Fabby Sent email.
 
11:34 AM
Suppose I have a file containing lines of text. I want to insert those lines, all in one line, with spaces in between, inside a command. What's the easiest way to do that?
So for example, a file containing:
foo
bar
and then I want to insert it after (say) the command ls. To make ls foo bar.
 
Depends on many things. Do your lines have spaces?
 
Actually, even better, could I specify which lines are to be included?
 
Or is it just foo bar?
On two lines
 
@terdon No.
None of of the lines have spaces.
 
So it's one word per line? Just do ls $(cat file)
or awk or anything else that selects the lines you want
 
11:38 AM
@FaheemMitha Is this an xy problem about xargs?
 
The usual caveats about spaces, bad file names etc apply of course.
 
@terdon That won't replace the line ending chars with spaces, though.
@AndrasDeak I don't know.
 
@FaheemMitha Why don't you try it? You might be surprised.
 
@FaheemMitha Are you building a bash command from arguments in a file?
 
Note how I did not quote the $()
terdon@tpad foo $ cat file
foo
bar
terdon@tpad foo $ ls -l $(cat file)
-rw-r--r-- 1 terdon terdon 0 Jan  8 11:36 bar
-rw-r--r-- 1 terdon terdon 0 Jan  8 11:36 foo
 
11:39 AM
More context. I need to do a binary search with a bunch of options. And then remove options as necessary.
@AndrasDeak Yes.
 
You know, there is a whole site for questions just like this. Where you can explain what you need and give examples and where we don't need to draw out the details step by step like this in chat. Hint, hint :P
 
@terdon Huh.
 
@FaheemMitha Does xargs ls -a your_file work?
 
@terdon Yes, I could ask a question. But there are many questions already, and I thought it was something simple that could be taken care of in chat. But sure, I can ask a question.
@AndrasDeak It might.
@AndrasDeak Do you think I should ask a question?
 
@AndrasDeak how would that work?
 
11:42 AM
@terdon would it not?
@FaheemMitha no, I think you should look at xargs
 
No. It will just hang there while xargs is waiting for input
You might be thinking of cat file | xargs ls
 
@AndrasDeak Looking. Also, Happy New Year.
 
But that isn't what Faheem asked for:
8 mins ago, by Faheem Mitha
Suppose I have a file containing lines of text. I want to insert those lines, all in one line, with spaces in between, inside a command. What's the easiest way to do that?
 
@terdon yeah, or xargs ls < file, but I figured that the -a switch was there as an altenrative
 
@AndrasDeak The switch is given to ls not xargs
 
11:43 AM
ah, so xargs -a your_file ls then?
 
Note there is stuff both before and after the insertion, so perhaps the ls example isn't the greatest.
 
But anyway, that won't put the contents of the file in one line with spaces in between. It all comes down to the contents of Faheem's file, the exact command he wants to run and details like that
@AndrasDeak Ah-ha! Yes, that one works.
 
Fine, I'll ask a question. It would probably be easier.
 
$ touch foo
$ touch bar
$ cat tmp
foo
bar
$ xargs -a tmp ls
bar  foo
@terdon I thought you meant it was fundamentally wrong
@FaheemMitha you'll have to be more clear about your requirements whether on main or here :)
 
@AndrasDeak Suppose I want to embed those in the middle of a command?
 
11:44 AM
@AndrasDeak No. I never use xargs so I don't know its options off the top of my head. I could just see that the one you gave me was giving the flag to ls not xargs
 
@terdon I don't use it either :P
 
@AndrasDeak I usually write detailed questions. As you can easily verify.
 
@FaheemMitha then maybe not.
@FaheemMitha OK.
 
@AndrasDeak You don't use what?
 
There's always tr '\n' ' '
 
11:45 AM
@FaheemMitha edited
 
command "$(tr '\n' ' ' < file)"
 
@AndrasDeak VirtualBox is on Fedora, so I'm good.
 
also @Faheem watch out for lines with spaces and special characters in them
 
@AndrasDeak I have a rough idea what a container is. I think it is like a Python virtual environment, in that a container isolates whatever is created inside it, from the environment outside of the container. Not sure what the difference between a container like Docker and a Python virtual environment is.
 
@AndrasDeak Ok.
The lines do have = in them.
 
11:50 AM
@terdon There was one error for a file during the rsync recursive copy operation:
13 hours ago, by Black Panther
rsync: [sender] read errors mapping "/run/media/user/folder/another_folder/folder ü/file.pdf": Input/output error (5)
ERROR: folder/another_folder/folder \#303\#274/file.pdf failed verification -- update retained.
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]
I found the cause of the error. Now I have a few questions about how to copy that file successfully:
4 hours ago, by Black Panther
Is it safe to say that I can run the command rsync -avv --inplace --no-whole-file "$1" "$destDir" and rsync will try to copy only the file that failed to copy because of an input/output error?
4 hours ago, by Black Panther
This would use rsync's delta-transfer algorithm and since only one file (i.e. file.pdf) failed to copy, only the file that failed to copy should be transferred. I don't think --inplace` is necessary here as there is no existing file. As for --no-whole-file, if I use --whole-file instead, will it still be only the file.pdf file that failed to copy that will be transferred except that the whole file will be transferred.
4 hours ago, by Black Panther
Basically, I want to confirm whether rsync -avv --inplace --no-whole-file "$1" "$destDir" command will only transfer the (whole) file.pdf file? I think I can use rsync to manually copy that single file, but I want to rerun the script which contains rsync -avv --inplace --no-whole-file "$1" "$destDir" with any necessary modifications to the rsync command in the script.
What do you think @terdon ?
 
12:39 PM
I think you should probably post a question on the main site, this is getting complicated.
 
1:36 PM
@AndrasDeak You might recall that some months ago we were discussing using TikZ to complete PDF forms. And you kindly provided example code for grids with (0,0) on the bottom left (as I recall) and posted it here. Do you happen to recall what the final version of your code was, and do you have it handy? And if not, do you remember what you posted back then?
I have a new form to fill, and of course I can't find your code, which I saved and tested.
Of course, this is another reason why it's good to ask questions as questions...
 
And you haven’t asked your question from earlier ;-).
 
@StephenKitt Not yet. I'm getting there. I wish I had a few extra hands. Or a cloning machine to clone myself. 5 Faheem's could get a lot more done.
 
1:52 PM
if anything doesn't work let me know and we can fix it
 
@AndrasDeak That looks good. I was looking at the page after that. So you don't have a version after that, then?
 
Well I don't "have" anything. I wrote whatever I had in chat, so if it's not in the transcript then it never was.
 
I've never uninstalled jre from my mac but I need to install it every time I want to use a java application
 
@AndrasDeak Ok. So you didn't post a followup/modified version to chat after that one, then? I don't see one.
 
Not that I can tell, unless we came back to the topic days later
 
1:56 PM
@AndrasDeak No, I don't think so.
 
@AndrasDeak That was an earlier version? I'd have to look carefully through it to tell.
 
That's every mention of "tikzpicture" by me. Topmost message is the newest. I believe that's the ones I linked to.
 
@AndrasDeak Ah yes. Ok. I was confused, I thought that was a page from the transcript. NI didn't initially realise it was a page of search results.
 
2:23 PM
disk names wouldn't remain constant between operating systems right? for example if I have /dev/sdf failed on one install and then boot a live disk there is no guarantee it will still be /dev/sdf?
 
@jesse_b no guarantee, yes, in fact if you boot off a USB drive there’s a decent chance that that will be sda and shift everything else
there’s not even a guarantee with the same operating system
 
Thanks
 
2:44 PM
@terdon I was overthinking it. I'm just gonna use rsync to copy the single file that failed to be copied by rsync.
I've never heard of antivirus on Linux. Is Linux immune to malware? A file I want to download has a warning that it could be malware.
 
First google duckduckgo hit is unix.stackexchange.com/questions/2751/…, I'm sure there are newer threads too
Obvious recommendation: don't execute (or otherwise open) files from untrusted sources.
Vulnerabilities are found all the time in software you don't expect.
I mean code execution vulnerabilities specifically
 
@AndrasDeak That's interesting.
@AndrasDeak A pdf I need is giving me that potential malware warning.
Just by downloading and opening a pdf, can that cause problems if the pdf is malware?
I would think malware is only dangerous when you execute the file?
So, if I restrict a file to read permission only, even if that file is malware, it should not cause any problems
 
@BlackPanther if your system opens it with a pdf reader and there's no code execution vulnerability in the reader then it's safe :P
@BlackPanther I'm pretty sure I've seen vulnerabilities in things lke image viewers. As I said, "software you don't expect".
 
3:01 PM
@AndrasDeak That's good to know. When you say execution vulnerability, do you mean the susceptibility of a pdf reader to be used to execute code?
 
Yes. Hypothetically. I'm not aware of the frequency of such vulnerabilities.
 
A pdf reader opens a pdf, and somehow that pdf uses the pdf reader to execute itself.
 
see e.g. cvedetails.com/… for code execution vulnerability in PIL, a basic python image manipulation library
 
Could it work like that?
Sounds far fetched.
 
A vulnerability would allow a PDF not to execute the PDF (as if it were an executable itself), but it would cause the reader to execute a piece of code contained in the PDF.
That’s only for code execution vulnerabilities, which are a subset of vulnerabilities...
But even seemingly innocuous tools such as strings have ended up with vulnerabilities.
 
3:07 PM
@AndrasDeak That's a good read.
I see. Is there anyway to isolate a file from the rest of your system, so that if it is malware the malware cannot attack a system?
 
@BlackPanther the only 100% safe way to isolate a file is to open it on another system, disconnected from the network, and then destroy that system
but in the real world, using a VM is pretty safe
 
@StephenKitt What if I keep a pdf file on an external hard drive, and open that pdf that is stored on the external hard drive?
 
@BlackPanther it still runs on your system
 
4:11 PM
Well, I posted the question earlier discussed.
0
Q: Inserting command options from a file into a command

Faheem MithaContext: I'm trying to track down a Mercurial extension bug. Mercurial has extensions, which extend the base functionality of Mercurial. You can choose to load any number of these extensions, as you wish. Sometimes they interfere with each other. The command hg fold in the Evolve extension isn't ...

Should appear in the feed momentarily.
 
4:21 PM
I want to clarify my earlier statements about (not) discussing politics in this room. I'm personally biased from seeing heated and sometimes violent "discussions" around politics. I am not against civil, constructive discussions on any topic, including politics.
As with any Stack Exchange site, this chat room should be civil and abide by the Code of Conduct. Thanks!
3
I am still unable to form links consistently :/
 
@JeffSchaller I think these days political discussions might reasonably be of the form AAAAAHHHHHH!!!
That pretty much covers it, I think.
 
mostly /o\ in my case, but I won't get in the way if people enjoy talking about it
 
4:38 PM
@JeffSchaller I sometimes talk about politics in other SE rooms, but there seems little interest in general here.
I do occasionally talk about it here.
 
But we talk Indian and Hungarian politics. The problem is usually US politics ;)
 
@AndrasDeak Indian and Hungarian politics are problems too, at least if you happen to be Indian or Hungarian.
 
yeah, but at least there are very few Hungarians on the network, and in chat specifically
 
It's really other people's problems too, because it's one planet and all connected, but humans are not very good at seeing the connections in things.
 
I'm aware of one former regular on chat.SO in a room, and another in the PHP room
 
4:41 PM
@AndrasDeak Hungary isn't a very large country, is it?
 
Nope. There's ~10 M Hungarians. Give or take expats and minorities.
 
People pay more attention to US politics because they have a zillion nuclear bombs, a huge army, and hundreds of bases, so people are terrified of what they might do.
At least, speaking for myself.
 
Web 2.0 is also a very US-centric place.
 
Oh, and they regularly attack other countries, usually for no good reason. That's just another minor detail.
India and Pakistan have nuclear bombs too, unfortunately.
And plenty of animosity.
 
@FaheemMitha people tend to think that they will only bomb one another so it's "not our problem" ;)
 
4:44 PM
@AndrasDeak That's like 2 billion people or something. Or will be soon. Also, nuclear fallout spreads with the wind and stuff. It's one planet, remember.
They really should get the kindergarteners to repeat "ONE PLANET, ONE PLANET" at the beginning of morning school. Perhaps it would go in.
@AndrasDeak Well, that's larger than Denmark, New Zealand and Austria, at least.
 
 
1 hour later…
6:12 PM
@JeffSchaller We could talk here instead of the comments, if you need further clarification.
I don't suppose it matters. Though I'm heading to bed shortly.
I realise my initial attempt at describing the problem was quite poor. Sorry about that.
 
6:34 PM
LEEEEEEROOOOOOOOOOOY JENKINS
 
@FaheemMitha no problem! and if there's anything important, it should be in the question, of course. I'm half distracted, so I'll see if I can come up with something better. Head to bed; get some rest :)
 
@JeffSchaller Thank you. Take care.
 
@JeffSchaller I had to dispute the charge for those weights I ordered. That company is pretty sus. They sent me an email saying my order had shipped but included no tracking info, and then shortly after they updated their website saying that they had issues with the suppliers and were unable to fulfill any orders and everyone would get a refund. Which they never actually did
 
@jesse_b oooph, sorry to hear! My wife went through something similar with a shirt. They sent the wrong shirt, but when we went to return it, they offered all sorts of crazy alternatives, eventually landing in us keeping the shirt and getting a refund.
 
customer service is dead
I once ordered spaghetti and meatballs and they sent me linguini and meatballs, something about the shape of linguini noodles really creeps me out so I can't eat them. I called them to complain and the guy yelled at and insulted me because "linguini and spaghetti are the same thing"
He thought I was just trying to get a free meal out of them so he sent the driver back to pickup my uneaten food
@JeffSchaller what sort of alternatives?
 
6:50 PM
@jesse_b I'm trying to remember; they were so odd they didn't stick. I think one was: keep the shirt and have some amount of credit towards a different item; I think another might have been (keep the shirt) and have a partial refund. I remember they really didn't want the item to be returned. Probably a ding on their Amazon rating somehow.
 
@JeffSchaller I imagine it would cost them more to pay for shipping both ways than the profit on the item
 
@jesse_b that'd be true, but I think we were all slated to pay the return shipping!
 
well those would be unacceptable terms
 
yeah, it was weird, which raised our already raised suspicions, and made me wonder (among other things) if it was to remain in good standing with Amazon
 
It already bothers me that amazon often makes you pay for ups pickup on returns. I didn't drive to a store and buy the wrong item so I shouldn't have to drive to a storefront to return it
 
7:02 PM
I can't find an explanation of the options used in the following code:
> Turn Off
set +o history
Turn on
set -o history
https://unix.stackexchange.com/a/10923/289865
 
history
Enable command history, as described in Bash History Facilities. This option is on by default in interactive shells.
 
Thanks. What is the difference between +o and -o?
 
the opposite of what one might consider intuitive
 
o means option name right?
Short options have the syntax -a, -b, -c etc.
So then what is +o here?
 
- turns on and + turns off
 
7:11 PM
Yes, I know but why?
 
I don't know, as I said it's not intuitive to me. If Stephen were here I bet he would have an explanation of why it is actually the intuitive way and I'm probably just wrong :p
In fact I think someone has explained it to me before and I am just forgetting
 
I'm thinking - is the opposite of whatever the default state of the shell option is, and + is the opposite of whatever the the modified state of the shell option is.
Is that it?
 
-x is how all command options are written, and it has one obvious opposite?
n.b. obvious, not good
 
That makes sense
 
I was just about to write that -o is the default option.
 
7:18 PM
Just because I'm wrong all the time doesn't mean I wont continue to spew my outrageous assertions
 
@MichaelHomer The way you put it, it makes sense that -o is on and +o is off. Thanks Michael.
 
The POSIX rationale provides only "widespread historical practice" as justification
 
7:48 PM
@Kusalananda: odd, I guess macos doesn't use bsd bc?
 
@jesse_b Thanks for that pointer. I'll update the comment.
 
yeah looks like I have gnu bc
 
@BlackPanther + turns off (disables) only because - turns on (enables), and - enables because that's the common character that is used for command line options, and generally speaking, options enables features or behaviors.
The alternative would be e.g. set -o nohistory (as is done with options within the vi editor).
 
I'm happy as long as they don't change it to set --option
You sticking to your walking routine @Kusalananda?
 
8:04 PM
@Kusalananda Thanks for the insight.
@Kusalananda What does this command mean $ sh -c 'echo ${RESTIC_REPOSITORY:-unset}'?
 
sh -c means execute the following command using sh
 
@jesse_b I am. But I stepped it up a notch. I live right by a nature reserve/bird sanctuary, and there's a nice walk of almost exactly 5 km that I do in about 55 minutes ever morning at 7 am.
 
I think it tells the shell to run a command, but it is the part ${RESTIC_REPOSITORY:-unset} that I don't get
 
> ${parameter:-word}
If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted.
 
@BlackPanther It outputs the string unset if the environment variable RESTIC_REPOSITORY is empty or unset in that inline sh -c shell script.
 
8:07 PM
@Kusalananda That's very good. To walk that long where there isn't traffic must be great.
 
@Kusalananda nice, I never understood "bird watching" but I get a lot of blue jays, robins, and wood peckers in my back yard and they are always fascinating to watch
 
@BlackPanther Sure is. I've been sitting still for most of the year, and my back finally started to give in. The walks really help keep me upright.
 
exercise is so important to mental health as well, my life has changed completely because of it
 
@jesse_b I'm not much of a bird watcher. The area is nice. There are grazing cows during the warmer months.
 
@Kusalananda So that's a way of testing the value of a variable?
 
8:09 PM
@BlackPanther It's a way of substituting in a specific value if the variable is empty or unset.
 
@Kusalananda My dog is nearly 100 lbs (45kg) and often eats grass so I sort of have grazing cows in my back yard as well :P
 
@jesse_b :-) Poor boy tho...
 
${RESTIC_REPOSITORY:-unset} seems equivalent to var x = IsEmpty()? unset : "";
 
You can use it for default options.
 
What is the point of using sh -c in that command? Why not just echo ${RESTIC_REPOSITORY:-unset}?
When I run:
$ sh -c 'echo ${RESTIC_REPOSITORY:-unset}'
I get
bash: $: command not found...
Why?
 
8:15 PM
You have to take the $ out
That is just a placeholder for your prompt
A lot of technical manuals will use $ to indicate you should run as a user and # to indicate it should be run as root
 
Thanks. I missed that. I usually don't copy-paste code from the internet, so I forgot about the prompt.
 
I don't always copy and paste code from the internet but when I do I su do
as for the sh -c part, the environment will be different between /bin/sh and whatever your default shell is so maybe it's just trying to check if that is available in sh's environment
 
@jesse_b Remind me to tell you your jokes sucks.
:-)
 
:(
 
Sucky jokes are fun tho.
Need to brush some teeth... not my own. brb
 
8:19 PM
cat?
 
Mongolian death worm
 
tartar sand boa
 
All of the above, depending on time of month.
 
I couldn't imagine trying to coerce one of my cats to let me brush their teeth
 
@BlackPanther I see no real reason to run that command in a sh -c shell. Unless your current shell is not a POSIX shell at all (such as tcsh or fish). Then it would make sense.
 
8:30 PM
maybe it's a test to see if that variable's been exported?
 
@JeffSchaller That would make sense too actually.
 
I mean, the lazy people would run env|grep RESTIC_REPOSITORY, not that I would know...
 
Well, in that case you'd use ${RESTIC_REPOSITORY-unset} (no ":"), otherwise you'd get a false positive for the case when it is exported, but empty.
 
I'm using a command line program that gets values from shell environment variables. Why would this command line program stop using it's environment variables for configuration?
 
or "${RESTIC_REPOSITORY:?unset}"
 
8:33 PM
In other words, what is causing the environment variables to stop being used by the program. RESTIC_REPOSITORY and RESTIC_PASSWORD were not used even though I opened a new terminal window/tab.
 
@BlackPanther They may not have been exported in the current environment. Where did you set them and how? Oh, and how are you running restic?
The variables have to be set in the same environment as restic is using.
 
@jesse_b Wait, sh or bash creates a new (sub-shell), does sh -c also create a subshell? I assumed sh -c just executes a command using the shell (or as a shell)? I'm trying to find an analogy/comparison to sh -c using su -c which executes a command as the root user.
 
14
Q: Is a sub-shell the same thing as a child-shell

user79743There are this two names: a subshell and a child-shell. Yes, a child process will be started by any of this: sh -c 'echo "Hello"' ( echo "hello" ) echo "$(echo "hello") echo "hello" | cat Are all equivalent and share the same name? Do all share the same properties? POSIX has this definitio...

 
@Kusalananda I see, probably the author was using a non-POSIX shell and just left it in the documentation without mentioning why he used it.
 
@BlackPanther Or they wanted to make sure that it worked no matter what shell the reader was using.
 
8:43 PM
@JeffSchaller Or export -p | grep -i RESTIC_REPOSITORY which outputs:
declare -x RESTIC_PASSWORD=password
declare -x RESTIC_REPOSITORY=/path/to/restic/repo/
Is it the shell that adds the part declare -x?
Kinda looks like JavaScripts local variable declaration var x ='password'
@Kusalananda You just raised the difficulty. Just when I was thinking bash syntax isn't so bad.
 
I knew Tim had asked this very question, but regrettably there are no answers to it
 
@Kusalananda I set them using export RESTIC_REPOSITORY="/path/to/restic/repo" && export RESTIC_PASSWORD=password in the same terminal window that I ran sudo restic backup ...
All tests show that RESTIC_REPOSITORY and RESTIC_PASSWORD were exported.
@Kusalananda The same environment as in the same window I run restic in?
 
@BlackPanther export -p prints it in a shell-reusable way
 
It's an anomaly because restic snapshots works, which shows that when using the snapshots command restic sees the environment variables RESTIC_REPOSITORY and RESTIC_PASSWORD. However, when using the backup command restic does not see them.
@JeffSchaller Interesting? Meaning you can pipe it to sh or bash?
@MichaelHomer Yes?
 
@BlackPanther well, sure. declare -x is bash's native way to define a variable that's exported
but keep in mind that piping to a shell is going to create a temporary shell, making its variables pretty useless :)
 
8:57 PM
@BlackPanther sudo may well clear the environment.
Use sudo env RESTIC_PASSWORD=... RESTIC_REPOSITORY=... restic ...
 
@MichaelHomer Am I missing something? Gilles answer explains (very well) what a subshell is, the answer doesn't say whether a subshell is the same as a child shell.
 
Or even sudo env RESTIC_PASSWORD="$RESTIC_PASSWORD" RESTIC_REPOSITORY="$RESTIC_REPOSITORY" restic ...
Need to eat. brb
 
@JeffSchaller Cool. declare is also available to the user which means we can also declare variables using the syntax declare -x RESTIC_REPOSITORY=/path/to/restic/repo/
@JeffSchaller I will, thanks
@Kusalananda Really? su switchers user, so su also uses a different environment to the user.
I expected sudo to just run a command using root privileges, meaning that calling sudo does not change the current environment
@Kusalananda Oh you said clear
@Kusalananda I've not seen the env command in a long time. I think it runs a command line in a modified environment. Thanks.
Unfortunately I had to run restic by specifying the repo on the command line and entering the password interactively. When I get the chance to try sudo with env, I will.
 
sudo sudo -V will display what your sudoers configuration does with, inter alia, the environment
 
@MichaelHomer running sudo with sudo, interesting. I don't really get this part: "does with, inter alia, the environment".
 
If I want to upload a work project to a remote git repository, is it bad if I change the author and email from my work credentials to the git credentials I use on my personal laptop?
I don't understand the following shell while loop:
git rebase -i --rebase-merges --root; while true; do git commit --amend --no-edit --author "Theodore R. Smith <theodore@phpexperts.pro>"; git rebase --continue; done
The only way for a while loop to stop executing is if the while loop variable evaluates to false. So why is it that the above while loop does not cause an infinite loop?
 
9:46 PM
@BlackPanther do you want your credentials to be completely gone, or do you just want people to see the different credentials by default?
In any case you should probably ditch that hacky mess and use something from stackoverflow.com/questions/4981126/…
My first question was trying to figure out if you could just use a .mailmap git-scm.com/docs/git-check-mailmap
That would let people using git log to see your updated credentials, but your original creds would still be there. And github (and maybe others) don't support .mailmap as far as I know.
 
10:14 PM
@AndrasDeak I wanted my work user name and work email to be replaced by my personal laptop's username and email.
So that people see my personal laptop username and email
 
OK, that answers nothing
but you probably don't want mailmap
 
@AndrasDeak That looks better. Although the official git website has a warning about using git filter-branch git-scm.com/docs/git-filter-branch#_warning
 
@BlackPanther I didn't just mean the top answer, there are multiple approaches there
there are solutions with git rebase -x
Never used it myself, but it seems straightforward enough. Of course pitfalls could be anywhere.
 
@AndrasDeak This is very good. I found an example of how to use a mailmap here: stackoverflow.com/a/9491696/8825683
 
@BlackPanther you literally just create a .mailmap file. It doesn't touch the commits, only the presentation in git log.
That's why I asked what exactly you need. Mailmap is only a thin cover that anyone can peek under. Like having a name tag that distracts people from looking at your face. Whoever wants to look at your face can still do it. And github (and maybe other services) don't support having a name tag so people will only see your face there.
If you want to actually erase your work credentials then mailmap won't work. If the original data is not a secret, only inaccurate, then mailmap can work.
 
10:30 PM
@AndrasDeak I see. I wanted people who view my project to not see that the project was done on my work laptop but I was concerned about whether this is ethical. However, I just remembered the project uses a work email I no longer have, so I should probably update the email shown in the commits for that project, right?
 
No idea. There's probably not enough information here to decide, and in any case I'm too tired to solve ethical (and maybe legal [see licensing/copyright]) dilemmas ;)
 
When using a mailmap, if I run git log, in the commits, does it show the old email or the new email?
 
That's the whole point: it shows the new email, but only in a local git log.
you can just try it without committing anything
create a .mailmap file, and then git log
It should work automatically. If you don't like it, delete the file. It's all local.
of course if you like it you'll have to add and commit and push so that clones have the mailmap
 
@AndrasDeak Wait. The mailmap only works for the local git repository? So on github for example, my commits would still show my work username and email?
 
Yes, that's what I'm saying.
actually, I'm not even sure you can get github to tell you an email address
 
10:35 PM
@AndrasDeak git rebase -i changes the commit date, which is not good.
 
for instance in github.com/pyvista/pyvista/commit/… you see "adeak" committed, whereas there's a mailmap using my proper credentials
@BlackPanther how well did you look?
read the end of the second top-voted answer...
 
@AndrasDeak Too bad github doesn't support it, a mailmap is the most straight forward way.
@AndrasDeak haha, apparently sometimes what you create on a company laptop belongs to the company.
 
Perhaps there's a fundamental reason for that. For instance .mailmap can vary from commit to commit. When you're looking at a commit in git log you're using the .mailmap from the commit you're on. But when you're looking at a commit on github it might happen that you're not associated with a single branch. At least I think so; I'm not so sure about this. But it's plausible that they have a fundamental reason for not supporting it.
 
10:53 PM
@AndrasDeak Yes, that's it! I also wanted to know which projects are work projects and which are personal projects. So deleting my work credentials would mean in future I probably won't be able to separate work projects from personal projects. GitHub shows the username used to create an account on GitHub, not the username specified by git config --global user.name, and GitHub does not show the committers email.
The runner up solution after mailmap would have involved git filter branch stackoverflow.com/a/750182/8825683 stackoverflow.com/a/30737248/8825683 stackoverflow.com/a/4982271/8825683, or git filter remote. mailmap is what I will use.
Thanks
 
Why not the rebase version that preserves timestamps?
 
@AndrasDeak Is the mailmap included in the files and directories pushed to GitHub?
 
@BlackPanther I told you that too. I'm starting to think you're not paying too much attention, which isn't very motivating to keep helping you.
 
@AndrasDeak I didn't read (up to) this part:
> Per @Dave's comment below, you can also change the author while maintaining the original timestamps with:

git rebase -i YOUR_SHA -x "git commit --amend --author 'New Name <new_address@example.com>' -CHEAD"
That's very good to know. git rebase -i is back in the discussion.
 
11:07 PM
@AndrasDeak Maybe. If it was a problem they would probably do something about it.
 
perhaps the issue is that you're using depth-first-search to discuss in chat
it would probably be more fruitful for you to digest what's been said up to a given point and then reply, rather than always being 30 minutes behind the discussion
 
@AndrasDeak I want to have an idea which projects I did for work, and which I did for personal reasons.
 
I'll wait until you reach my last message with replies...
 
@AndrasDeak I must not have read that message, or maybe I'm just tired.
@AndrasDeak You make a good point
 
mailmap only works if it's there, so if you want it to be there you have to push it
 
11:20 PM
Got it. Thanks
You seem quite good with Python.
What's a good way for someone who is experienced with C# and Java to learn Python quickly?
 

« first day (3744 days earlier)      last day (1202 days later) »